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@latestOptional pin (0.2.1)
npx -y graphmyanything-mcp@0.2.1Cursor
.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@latestVS 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-mcpPoint 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- Run
sync— the CLI prints a short device code. - Open graphmyanything.com/connect and approve the code.
- Use
status,local, orlogoutsubcommands as needed.
| Env var | Purpose |
|---|---|
| GRAPHMYANYTHING_API_KEYalias GMA_API_KEY | Hosted 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
track—written/replacedcounts (upsert on same metric + ts).query— terses.*stats and maybe downsampledpts.chart— local SVGpath; 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
| What | Default path |
|---|---|
| SQLite metrics DB | ~/.graphmyanything/metrics.db |
| Chart SVGs | ~/.graphmyanything/charts/ |
| Env var | Purpose |
|---|---|
| GRAPHMYANYTHING_DB_PATH | Custom DB file |
| GRAPHMYANYTHING_CHARTS_DIR | Custom chart output directory |
MCP resources for agents
chart-guide—graphmyanything://docs/chart-guideusage-guide—graphmyanything://docs/usage-guide
The server's initialize response points agents at these resources.
Update to a newer package
- Bump @latest or your pinned version in MCP config (or rebuild Docker).
- Restart the MCP server / reload MCP in the client.
Next steps
- Examples — copy-paste prompts and tool JSON
- Agent guide — when to keep, store, update, and use metrics
- Hosted API — /c/<id> URLs and plan limits
- Stripe MRR — n8n and restricted read keys
Source on GitHub: casahome2000/graphmyanything / quickstart.md