Mcp Developer

MCP Developer automation and integration for building Model Context Protocol solutions

MCP Developer is a community skill for building Model Context Protocol servers and clients, covering tool definition, resource management, prompt templates, transport configuration, and integration with AI assistant platforms.

What Is This?

Overview

MCP Developer provides patterns for creating Model Context Protocol servers that expose tools, resources, and prompts to AI assistants. It covers server initialization, tool handler implementation, resource endpoint definition, transport layer configuration using stdio and HTTP, and client connection management. The skill enables developers to extend AI assistant capabilities by building custom MCP integrations that connect to external services and data sources.

Who Should Use This

This skill serves developers building custom integrations between AI assistants and external services, teams creating internal tools that AI agents can invoke during conversations, and platform engineers designing MCP server infrastructure for organization-wide AI workflows.

Why Use It?

Problems It Solves

AI assistants cannot access external services or databases without custom integration code. Each assistant platform has different plugin formats, making integrations non-portable. Building reliable tool interfaces requires handling input validation, error reporting, and response formatting consistently. Without a standard protocol, connecting AI capabilities to internal systems requires building bespoke bridges for each combination.

Core Highlights

Standardized tool definitions describe callable functions with typed parameters and documentation that assistants can discover automatically. Resource endpoints expose data sources that assistants can read without executing actions. Transport abstraction supports both stdio for local processes and HTTP for remote server deployments. Schema validation ensures tool inputs match expected types before handler execution.

How to Use It?

Basic Usage

from dataclasses import dataclass, field
from typing import Any, Callable
import json

@dataclass
class ToolDefinition:
    name: str
    description: str
    parameters: dict[str, Any]
    handler: Callable = None

@dataclass
class MCPServer:
    name: str
    version: str = "1.0.0"
    tools: dict[str, ToolDefinition] = field(default_factory=dict)

    def register_tool(self, tool: ToolDefinition):
        self.tools[tool.name] = tool

    def list_tools(self) -> list[dict]:
        return [
            {"name": t.name, "description": t.description,
             "inputSchema": t.parameters}
            for t in self.tools.values()
        ]

    def call_tool(self, name: str, arguments: dict) -> dict:
        tool = self.tools.get(name)
        if not tool:
            return {"error": f"Tool {name} not found"}
        try:
            result = tool.handler(**arguments)
            return {"content": [{"type": "text", "text": str(result)}]}
        except Exception as e:
            return {"error": str(e), "isError": True}

Real-World Examples

import json
import sys
from dataclasses import dataclass, field

@dataclass
class Resource:
    uri: str
    name: str
    mime_type: str
    reader: object = None

class MCPStdioTransport:
    def __init__(self, server: MCPServer):
        self.server = server
        self.resources: dict[str, Resource] = {}

    def add_resource(self, resource: Resource):
        self.resources[resource.uri] = resource

    def handle_request(self, request: dict) -> dict:
        method = request.get("method", "")
        params = request.get("params", {})

        if method == "tools/list":
            return {"tools": self.server.list_tools()}
        elif method == "tools/call":
            return self.server.call_tool(
                params["name"], params.get("arguments", {})
            )
        elif method == "resources/list":
            return {"resources": [
                {"uri": r.uri, "name": r.name, "mimeType": r.mime_type}
                for r in self.resources.values()
            ]}
        return {"error": f"Unknown method: {method}"}

    def run(self):
        for line in sys.stdin:
            request = json.loads(line.strip())
            response = self.handle_request(request)
            response["id"] = request.get("id")
            sys.stdout.write(json.dumps(response) + "\n")
            sys.stdout.flush()

Advanced Tips

Implement request validation middleware that checks tool arguments against JSON schemas before passing them to handlers. Use connection pooling for MCP servers that make outbound API calls to external services. Add logging with request IDs to trace tool invocations through the complete request lifecycle.

When to Use It?

Use Cases

Build a database query tool that lets AI assistants search and retrieve records safely. Create file management servers that provide controlled access to project directories. Develop API gateway tools that wrap third-party services with authentication and rate limiting for assistant consumption.

Related Topics

Model Context Protocol specification, AI assistant tool systems, JSON-RPC communication, server transport patterns, and API integration development.

Important Notes

Requirements

A runtime environment supporting the chosen transport such as stdio or HTTP server. JSON schema definitions for all tool input parameters. Understanding of the MCP message format for request and response handling.

Usage Recommendations

Do: provide clear tool descriptions that help the AI assistant decide when to use each tool. Validate all input parameters before executing tool logic to prevent errors. Return structured error messages that the assistant can interpret and communicate to users.

Don't: expose destructive operations without confirmation mechanisms in the tool handler. Return raw exception tracebacks that leak internal implementation details. Create tools with overlapping functionality that confuse the assistant about which tool to select.

Limitations

MCP servers must handle concurrent requests carefully when tools modify shared state. Transport layer choices affect deployment flexibility, with stdio limited to local processes. Tool discovery only works with assistants that support the MCP protocol natively.