Command Palette

Search for a command to run...

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

Mcp Tools Development

БесплатноБез исполняемых скриптовНе проверен

Comprehensive guide for creating and modifying AIDB MCP tools with agent optimization

ai-debugger-incот ai-debugger-inc★ 22 звезды на GitHub

Об этом скилле

MCP Tools Development Skill

This skill guides you through creating and modifying MCP tools for the AI Debugger (AIDB). MCP tools are the primary interface between AI agents and the debugging system - they must be fast, accurate, and clear.

Core Philosophy: Agent Optimization

MCP tools are user-facing products. Every response is read by an AI agent with limited context. Your goal:

  1. Accuracy: Responses must contain correct information (line numbers, values, state)
  2. Clarity: Summaries must be clear and actionable, not verbose
  3. Speed: Operations must be fast (agents iterate rapidly)
  4. No Junk: No unnecessary fields, no bloated payloads, no redundant data

Context windows are sacred - every token matters.

Quick Start

When to Use This Skill

Invoke this skill when:

  • Creating a new MCP tool (e.g., aidb.watch for watchpoints)
  • Modifying existing tool behavior
  • Fixing MCP response issues
  • Optimizing tool performance
  • Debugging tool handler errors

Related Skills

When developing MCP tools, you may also need:

  • dap-protocol-guide - MCP tools use DAP types for all debugging operations
  • testing-strategy - MCP tools tested with DebugInterface for content accuracy
  • code-reuse-enforcement - Must use existing constants/enums from core package

MCP Architecture Overview

For complete MCP server architecture, see:

  • docs/developer-guide/overview.md - System architecture showing MCP layer integration
  • src/aidb_mcp/ - MCP server implementation
User Request
    ↓
MCP Server (src/aidb_mcp/server/)
    ↓
Handler Registry (src/aidb_mcp/handlers/registry.py)
    ↓
Tool Handler (src/aidb_mcp/handlers/{category}/)
    ↓
DebugService (src/aidb/service/)
    ↓
Response Builder (src/aidb_mcp/responses/)
    ↓
MCP Response

Key Components:

  • Tool Definitions (src/aidb_mcp/tools/definitions.py): Tool schemas and metadata
  • Handler Registry (src/aidb_mcp/handlers/registry.py): Dispatcher to handlers
  • Tool Handlers (src/aidb_mcp/handlers/{category}/): Business logic
  • Response Builders (src/aidb_mcp/responses/): Standardized response construction
  • Decorators (src/aidb_mcp/core/decorators.py): Common handler functionality

Resource Files

For detailed guidance, see these resources:

Code Reuse: Don't Reinvent

Before writing new code, check these shared modules:

Constants and Enums

File: src/aidb_mcp/core/constants.py

from aidb_mcp.core.constants import (
    ToolName,           # Tool names (INSPECT, STEP, EXECUTE, etc.) - class
    SessionAction,      # Session actions (START, STOP, STATUS, etc.) - Enum
    InspectTarget,      # Inspection targets (LOCALS, GLOBALS, STACK, etc.) - Enum
    StepAction,         # Step actions (INTO, OVER, OUT) - Enum
    ExecutionAction,    # Execution actions (RUN, CONTINUE) - Enum
    ErrorCode,          # Standardized error codes - Enum (in exceptions.py)
    ResponseStatus,     # Response statuses (OK, ERROR, WARNING) - class
    ParamName,          # Common parameter names - class
    ResponseFieldName,  # Response field names - class
    MCPResponseField,   # MCP protocol field names - class
)

Note: Some constants use classes instead of Enums for flexibility. Never use magic strings - always use constants.

Exception Types

File: src/aidb_mcp/core/exceptions.py

from aidb_mcp.core.exceptions import (
    ErrorCode,          # Error codes enum
    ErrorCategory,      # Error categories (VALIDATION, SESSION, etc.)
    ErrorRecovery,      # Recovery strategies
    classify_error,     # Classify exception by type/message
    get_recovery_strategy,     # Get recovery options
    get_suggested_actions,     # Get user-friendly actions
)

Use these for error handling - don't create new exception types unless necessary.

Performance Types

File: src/aidb_mcp/core/performance_types.py

from aidb_mcp.core.performance_types import (
    SpanType,           # Performance span types
    PerformanceSpan,    # Span data class
    TimingFormat,       # Output formats
)

Use for performance tracking - consistent metrics across tools.

Quick Patterns

Creating a New Tool (Step-by-Step)

Note: Examples below use placeholder names (YOUR_TOOL, YourResponse). See actual implementations in src/aidb_mcp/handlers/execution/stepping.py and src/aidb_mcp/responses/execution.py.

1. Define the tool schema (src/aidb_mcp/tools/definitions.py):

Tool(
    name=
Полный SKILL.md на GitHub

Установить Mcp Tools Development в Claude Code и Claude Desktop

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

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

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

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

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

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/handler-composition-patterns.mdresources/handler-decorators-reference.mdresources/testing-mcp-tools.mdresources/tool-architecture.md

FAQ

Что делает скилл Mcp Tools Development?

Comprehensive guide for creating and modifying AIDB MCP tools with agent optimization

Как установить скилл Mcp Tools Development?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл Mcp Tools Development запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить Mcp Tools Development с