Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

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от 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.json needs 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_supported in packages/frontend/public/.well-known/oauth-authorization-server and oauth-protected-resource
  • the tool tables between the GENERATED TOOL TABLES markers in packages/frontend/public/skills/connect-moneymatter/SKILL.md
  • the sha256 of that SKILL.md in packages/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.
  • input is a plain shape of Zod fields (no outer z.object(...)). Omit it for a tool with no inputs.
  • run gets { userId, args, extra } and returns the data; never call jsonContent, getUserId, requireScope, requireFeature, assertBaseCurrencyUnlocked or trackMcpToolUsed for the def's own guards. Money instances serialize to decimals via toJSON().
  • description leaves out the Requires finance:X scope. sentence; it is appended from access. 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 with new Date(args.date) if the service expects a Date.

Naming, access and guards

  • Names: read tools start with get_, list_, search_ or preview_ and have access: 'read'; nothing else does (the /mcp route already requires finance:read).
  • Access: 'write' is the default. delete_* tools, and tools that permanently remove data without delete_ in the name (merge_payees, bulk_delete_*), use 'delete', and the name goes into DESTRUCTIVE_TOOLS in tool-scopes-drift.unit.ts when it lacks the prefix. A soft delete that a restore tool undoes is 'write'. A tool whose delete path is optional (ignore_payee_name with force) is 'write', checks finance:delete in run, names that path in conditionalDelete ('with force'), and goes into CONDITIONAL_DELETE_TOOLS.
  • Read-only and demo users: the scope check rejects both, on every write and delete tool.
  • **Base-currency lock:
Полный SKILL.md на GitHub

Установить add-mcp-tool в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Grep
Glob
Bash

FAQ

Что делает скилл 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), без исполняемых скриптов.

Похожие скиллы

Сравнить add-mcp-tool с