GraphMyAnything

5-minute quick start

Local MCP server with SQLite metric memory. Build once. Ask forever.

Install the MCP server

Default install pulls the latest published release from graphmyanything-mcp. Requires Node.js 22.13+ (built-in node:sqlite). Clients launch over stdio — your IDE runs npx, not you during chat.

Latest (recommended)

npx -y graphmyanything-mcp@latest

Optional pin (0.2.1)

npx -y graphmyanything-mcp@0.2.1

Cursor

.cursor/mcp.json or Settings → MCP → Add server.

mcp.json

{
  "mcpServers": {
    "graphmyanything": {
      "command": "npx",
      "args": ["-y","graphmyanything-mcp@latest"]
    }
  }
}

Claude Desktop

claude_desktop_config.json — macOS ~/Library/Application Support/Claude/…; Windows %APPDATA%\Claude\….

claude_desktop_config.json

{
  "mcpServers": {
    "graphmyanything": {
      "command": "npx",
      "args": ["-y","graphmyanything-mcp@latest"]
    }
  }
}

Claude Code

CLI

claude mcp add graphmyanything -- npx -y graphmyanything-mcp@latest

VS Code

Settings → MCP (or workspace mcp.json). Same shape as Cursor.

mcp.json

{
  "mcpServers": {
    "graphmyanything": {
      "command": "npx",
      "args": ["-y","graphmyanything-mcp@latest"]
    }
  }
}

Windsurf

User or workspace MCP config: add the same command / args under mcpServers.graphmyanything.

mcp.json

{
  "mcpServers": {
    "graphmyanything": {
      "command": "npx",
      "args": ["-y","graphmyanything-mcp@latest"]
    }
  }
}

Docker

Persistent data under /data. Image sets GRAPHMYANYTHING_DB_PATH=/data/metrics.db.

Build & run

docker build -t graphmyanything-mcp https://github.com/casahome2000/graphmyanything.git
docker run -i --rm -v gma-data:/data graphmyanything-mcp

Point your MCP host at docker run -i … graphmyanything-mcp as the stdio command.

Hosted sync (optional)

Mirror local SQLite to graphmyanything.com for API keys, plan limits, and live /c/<id> chart links. Same five tools; writes go to hosted storage and stay in your local DB.

Device login

npx -y graphmyanything-mcp@0.2.1 sync
  1. Run sync — the CLI prints a short device code.
  2. Open graphmyanything.com/connect and approve the code.
  3. Use status, local, or logout subcommands as needed.
Env varPurpose
GRAPHMYANYTHING_API_KEYalias GMA_API_KEYHosted API bearer after sync (pin package @0.2.1 or newer)

Details: Hosted API & share URLs.

First prompt

After the server shows up in your client's MCP list, try:

Track my weight as 182.4 lb in metric health.weight.lb, then query the last 7 days and chart it with a dark line chart.

What you should see

  1. track — written / replaced counts (upsert on same metric + ts).
  2. query — terse s.* stats and maybe downsampled pts.
  3. chart — local SVG path; open it in your IDE or browser.

Sample track response

{
  "ok": true,
  "metric": "health.weight.lb",
  "written": 1,
  "replaced": 0,
  "tokens_estimate": 20
}

Where data lives

WhatDefault path
SQLite metrics DB~/.graphmyanything/metrics.db
Chart SVGs~/.graphmyanything/charts/
Env varPurpose
GRAPHMYANYTHING_DB_PATHCustom DB file
GRAPHMYANYTHING_CHARTS_DIRCustom chart output directory

MCP resources for agents

  • chart-guide — graphmyanything://docs/chart-guide
  • usage-guide — graphmyanything://docs/usage-guide

The server's initialize response points agents at these resources.

Update to a newer package

  1. Bump @latest or your pinned version in MCP config (or rebuild Docker).
  2. Restart the MCP server / reload MCP in the client.

Next steps

Source on GitHub: casahome2000/graphmyanything / quickstart.md