add-mcp-tool
БесплатноБез исполняемых скриптовНе проверенAdd a new tool to the MoneyMatter MCP server. Auto-triggers when the user asks to "add MCP tool", "new MCP tool", "expose X via MCP", or when exposing any…
от letehaha★ 280 звёзд на GitHubОб этом скилле
Add MCP Tool
Adds a new tool to the MCP server at https://mcp.moneymatter.app/mcp without breaking any drift check.
When to use
- User asks to add/expose a new MCP tool
- User wants an existing backend service callable by MCP clients (Claude Desktop, ChatGPT, etc.)
- Any time the tool list at
packages/frontend/public/.well-known/mcp/server-card.jsonneeds to grow
Architecture at a glance
Each MCP tool is a defineTool def wrapping an existing backend service:
Service (@services/...)
↓ called by run()
Tool def (packages/backend/src/services/mcp/tools/<name>.ts, `export const fooBarTool = defineTool({...})`)
↓ listed in
ALL_TOOLS (packages/backend/src/services/mcp/toolsets.ts), grouped by def.toolset
↓ registered by registerDefinedTool via
createMcpServer({ toolsets }) (packages/backend/src/services/mcp/server.ts)
registerDefinedTool (define-tool.ts) runs the guards, in this fixed order, then wraps the result:
getUserId → requireScope(finance:<access>) [write/delete] → requireFeature [feature] → assertBaseCurrencyUnlocked [lock] → trackMcpToolUsed → run → jsonContent({ data })
It also appends Requires finance:<access> scope. to the description (plus the conditionalDelete path), wraps input in z.strictObject (built once per def) and sets readOnlyHint: true on reads and destructiveHint: true on deletes; writes leave destructiveHint unset, which the spec reads as destructive.
npm run mcp:generate-metadata (in packages/backend) generates these from ALL_TOOLS, TOOLSET_DESCRIPTIONS, MCP_SCOPES_SUPPORTED and MCP_SERVER_INFO; never edit them by hand:
packages/frontend/public/.well-known/mcp/server-card.json— machine-readable tool list (each description is the first sentence of the def's)scopes_supportedinpackages/frontend/public/.well-known/oauth-authorization-serverandoauth-protected-resource- the tool tables between the
GENERATED TOOL TABLESmarkers inpackages/frontend/public/skills/connect-moneymatter/SKILL.md - the
sha256of that SKILL.md inpackages/frontend/public/.well-known/agent-skills/index.json
Checklist (complete every step)
When adding tool my_new_tool:
1. Create the tool file
Path: packages/backend/src/services/mcp/tools/my-new-tool.ts (kebab-case filename)
import { FEATURES } from '@bt/shared/types'; // only for a feature-gated tool
import { recordId } from '@common/lib/zod/custom-types';
import { myService } from '@services/path/to/my-service';
import { z } from 'zod';
import { defineTool } from '../define-tool';
export const myNewToolTool = defineTool({
name: 'my_new_tool',
toolset: 'investments',
access: 'write',
feature: FEATURES.budget_plan, // only when the REST route has requireFeature
description: 'What it returns and when an agent should call it. One sentence plus a hint on key fields.',
input: {
someId: recordId().describe('...'),
optionalFilter: z.string().optional().describe('...'),
},
run: ({ userId, args }) => myService({ userId, ...args }),
});
Rules:
- Tool name is snake_case. The export is
<camelName>Tool, the file<kebab-name>.ts. inputis a plain shape of Zod fields (no outerz.object(...)). Omit it for a tool with no inputs.rungets{ userId, args, extra }and returns the data; never calljsonContent,getUserId,requireScope,requireFeature,assertBaseCurrencyUnlockedortrackMcpToolUsedfor the def's own guards. Money instances serialize to decimals viatoJSON().descriptionleaves out theRequires finance:X scope.sentence; it is appended fromaccess. Its first sentence must stand alone: it is what the server card and the skill tables show.- Checks that are not guards stay at the top of
run: a conditional scope (if (args.force) requireScope({ extra, scope: 'finance:delete' })),assertNotDemoUser({ extra }), argument checks that throw, and REST schema re-parses with refines. - Use
z.enum([...])for enum args. Dates come in as ISO strings; convert withnew Date(args.date)if the service expects aDate.
Naming, access and guards
- Names: read tools start with
get_,list_,search_orpreview_and haveaccess: 'read'; nothing else does (the/mcproute already requiresfinance:read). - Access:
'write'is the default.delete_*tools, and tools that permanently remove data withoutdelete_in the name (merge_payees,bulk_delete_*), use'delete', and the name goes intoDESTRUCTIVE_TOOLSintool-scopes-drift.unit.tswhen it lacks the prefix. A soft delete that a restore tool undoes is'write'. A tool whose delete path is optional (ignore_payee_namewithforce) is'write', checksfinance:deleteinrun, names that path inconditionalDelete('with force'), and goes intoCONDITIONAL_DELETE_TOOLS. - Read-only and demo users: the scope check rejects both, on every write and delete tool.
- **Base-currency lock:
Установить add-mcp-tool в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditGrepGlobBashFAQ
Что делает скилл add-mcp-tool?
Add a new tool to the MoneyMatter MCP server. Auto-triggers when the user asks to "add MCP tool", "new MCP tool", "expose X via MCP", or when exposing any existing backend service to MCP clients. Handles every metafile the drift tests check.
Как установить скилл add-mcp-tool?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл add-mcp-tool запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic