MCP Server
The official MCP bridge is packaged as @duitmyself/api-mcp. It connects MCP-capable agents to the DuitMyself Public API over stdio.
When to choose MCP
Section titled “When to choose MCP”Use the bridge when you want:
- structured tool calls instead of hand-written HTTP requests
- built-in rate-limit and request metadata in tool results
- a first-party bootstrap prompt and resource set for agents
Run from npm
Section titled “Run from npm”DUITMYSELF_API_KEY=key_... npx -y @duitmyself/api-mcpOptional:
DUITMYSELF_API_BASE_URL=https://api.duitmyself.appClaude Code
Section titled “Claude Code”Add the published server with Claude Code’s stdio MCP command flow:
claude mcp add --transport stdio duitmyself -- npx -y @duitmyself/api-mcpThen set DUITMYSELF_API_KEY in the server environment when prompted.
Claude Desktop
Section titled “Claude Desktop”Use the standard Claude Desktop MCP config shape:
{ "mcpServers": { "duitmyself": { "command": "npx", "args": ["-y", "@duitmyself/api-mcp"], "env": { "DUITMYSELF_API_KEY": "key_..." } } }}Add DUITMYSELF_API_BASE_URL under env only when you need a preview lane or custom host.
Run from repo source
Section titled “Run from repo source”From the repository root:
pnpm installDUITMYSELF_API_KEY=key_... pnpm mcp:stdioOptional:
DUITMYSELF_API_BASE_URL=https://api.duitmyself.appIf DUITMYSELF_API_BASE_URL is omitted, the bridge defaults to the production API host.
Registry metadata for the published server lives in .mcp/server.json in the repository.
Exposed tools
Section titled “Exposed tools”duitmyself_get_agent_contextduitmyself_list_accountsduitmyself_upsert_accountduitmyself_list_categoriesduitmyself_upsert_categoryduitmyself_list_payeesduitmyself_upsert_payeeduitmyself_list_transactionsduitmyself_upsert_transaction
Exposed resources
Section titled “Exposed resources”duitmyself://meduitmyself://agent/context
Exposed prompt
Section titled “Exposed prompt”duitmyself-agent-playbook
Why use the bridge
Section titled “Why use the bridge”- agents get structured tool outputs instead of scraping raw HTTP
- rate-limit metadata is preserved in tool responses
- the recommended DuitMyself bookkeeping rules ship with the prompt and bootstrap tool
- the bridge is built on the same official TypeScript client used elsewhere in the repo