Mcp Tools Development
БесплатноБез исполняемых скриптовНе проверенComprehensive guide for creating and modifying AIDB MCP tools with agent optimization
от 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:
- Accuracy: Responses must contain correct information (line numbers, values, state)
- Clarity: Summaries must be clear and actionable, not verbose
- Speed: Operations must be fast (agents iterate rapidly)
- 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.watchfor 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 integrationsrc/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:
- Tool Architecture - Tool structure, handlers, decorators
- Handler Decorators - @with_execution_context, @require_initialized_session
- Composition Patterns - @timed, best practices, performance
- Testing MCP Tools - E2E and integration testing
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 insrc/aidb_mcp/handlers/execution/stepping.pyandsrc/aidb_mcp/responses/execution.py.
1. Define the tool schema (src/aidb_mcp/tools/definitions.py):
Tool(
name=
Установить Mcp Tools Development в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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-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