npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brianbuildz/draw-agent

v0.2.0

Published

An agent for drawing graphs, charts, diagrams, and visualizations following the Model Context Protocol (MCP)

Readme

Draw Agent MCP Server

An agent that creates graphs, charts, flow charts, and diagrams following the Model Context Protocol (MCP). This agent is designed to help visualize data and concepts through appropriate charts and diagrams.

Overview

This package provides an MCP server that can analyze data, determine the most appropriate visualization type, and generate visual representations including charts, graphs, flow charts, and diagrams.

Key Features

  • Data Visualization: Create various charts and graphs based on provided data
  • Flow Charts & Diagrams: Generate visual representations of processes and relationships
  • Intelligent Format Selection: Automatically determine the most appropriate visualization type
  • Markdown/Image Outputs: Returns visualizations in suitable formats

Logging in MCP Servers

This agent follows the MCP protocol requirements for logging. Instead of using direct console.log or console.error calls (which would break the JSON-based protocol), it uses safe logging utilities from utils/logger.js.

When developing MCP servers:

  1. Never use direct console.log/console.error - These break the JSON protocol
  2. Always use the safe logging utilities:
    import { log, logError } from './utils/logger.js';
       
    // Instead of console.log
    log('Your message here', optionalData);
       
    // Instead of console.error
    logError('Error message', errorObject);
  3. These utilities ensure all output is valid JSON sent to stderr, maintaining protocol integrity

Installation

npm install -g @brianbuildz/draw-agent

Usage

As a Command Line Tool

Run the MCP server:

draw-agent

This will start the MCP server. The server communicates using the MCP protocol via standard input/output.

Integration with Cursor

To use the draw-agent with Cursor:

  1. Install the agent globally:

    npm install -g @brianbuildz/draw-agent
  2. In Cursor, click the "+" button in the Agents panel to add a new agent.

  3. Set the following:

    • Name: Draw Agent
    • Command: npx -y draw-agent
  4. Click "Add" to register the agent.

  5. You can now use the Draw Agent by sending commands to it in Cursor. For example:

    @Draw Agent Please create a pie chart showing market share for products A (35%), B (45%), and C (20%)
  6. The agent will respond with a Mermaid diagram that you can view directly in Cursor.

Verification

To verify the agent is working correctly, run:

node verify-cursor.js

This will start the agent and test it with different chart types.

In an MCP Client

When provided with data or descriptions, the agent will analyze the input and generate appropriate visualizations.

Data Formats

The draw-agent accepts the following data formats:

Pie Charts

{
  "labels": ["Item 1", "Item 2", "Item 3"],
  "values": [30, 40, 30]
}

Flowcharts

{
  "nodes": [
    { "id": "A", "label": "Start" },
    { "id": "B", "label": "Process", "shape": "rectangle" }
  ],
  "edges": [
    { "from": "A", "to": "B", "label": "Begin" }
  ]
}

Development

This agent was built using the hello-agent template as a starting point. It implements the MCP protocol and provides visualization capabilities using Mermaid.js.

License

MIT