Skip to content
Agent Orchestration
Skill

/mcp-builder

Build MCP (Model Context Protocol) servers that enable LLMs to interact with external services.

BOOST
From plugin
hermes-desktop
17790 skills
Install
$ npx -y skills add redwoodog/hermes-desktop --skill mcp-builder --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/mcp-builder

Context preview

The summary Claude sees to decide when to auto-load this skill.

Build MCP (Model Context Protocol) servers that enable LLMs to interact with external services.

SKILL.md

mcp-builder.SKILL.md
name: mcp-builder
description: Build MCP (Model Context Protocol) servers that enable LLMs to interact with external services.
tools: bash, read_file, write_file, edit_file, glob, grep, web_search

MCP Server Builder

You are an expert at building MCP (Model Context Protocol) servers. MCP is a protocol that enables LLMs to interact with external services through well-defined tools. You build servers in Python (using FastMCP) or TypeScript (using the MCP SDK).

What is MCP?

MCP servers expose **tools** that an LLM can call. Each tool has:

  • A name (snake_case)
  • A description (what it does, when to use it)
  • Input parameters (typed, with descriptions)
  • A return value

The server runs as a process that communicates with the LLM host via stdio or SSE.

Python Server (FastMCP)

Setup

pip install fastmcp

Basic Server Template

from fastmcp import FastMCP

mcp = FastMCP("my-service")

@mcp.tool()
def get_weather(city: str, units: str = "celsius") -> str:
    """Get the current weather for a city.

    Args:
        city: The city name (e.g., "San Francisco")
        units: Temperature units - "celsius" or "fahrenheit"
    """
    # Implementation here
    return f"Weather in {city}: 72F, sunny"

@mcp.tool()
def search_documents(query: str, max_results: int = 10) -> list[dict]:
    """Search the document database.

    Args:
        query: The search query string
        max_results: Maximum number of results to return
    """
    # Implementation here
    return [{"title": "Example", "snippet": "..."}]

if __name__ == "__main__":
    mcp.run()

Running

# stdio mode (for local LLM hosts)
python server.py

# SSE mode (for remote connections)
python server.py --transport sse --port 8000

TypeScript Server

Setup

npm init -y
npm install @modelcontextprotocol/sdk zod

Basic Server Template

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

const server = new McpServer({
  name: "my-service",
  version: "1.0.0",
});

server.tool(
  "get_weather",
  "Get the current weather for a city",
  {
    city: z.string().describe("The city name"),
    units: z.enum(["celsius", "fahrenheit"]).default("celsius"),
  },
  async ({ city, units }) => {
    // Implementation here
    return {
      content: [{ type: "text", text: `Weather in ${city}: 72F, sunny` }],
    };
  }
);

async function main() {
  const transport = new StdioServerTransport();
  await server.connect(transport);
}

main().catch(console.error);

Workflow for Building an MCP Server

Step 1: Define the Tools

List every tool the server should expose:

  • What does each tool do?
  • What inputs does it need?
  • What does it return?
  • When should the LLM use it vs. other tools?

Step 2: Choose Python or TypeScript

  • **Python** if the service involves data science, ML, or existing Python libraries
  • **TypeScript** if it integrates with web APIs or the host is Node.js-based

Step 3: Implement the Server

Follow the template above. For each tool:

1. Write a clear docstring/description - this is what the LLM reads to decide when to use the tool 2. Type all parameters with descriptions 3. Handle errors gracefully - return error messages, don't crash 4. Return structured data when possible

Step 4: Handle Authentication

If the service requires API keys or tokens:

import os

@mcp.tool()
def api_call(query: str) -> str:
    """Call the external API."""
    api_key = os.environ.get("API_KEY")
    if not api_key:
        return "Error: API_KEY environment variable not set"
    # Use the key...

Step 5: Add Resources (Optional)

Resources provide read-only data the LLM can access:

@mcp.resource("config://settings")
def get_settings() -> str:
    """Current server configuration."""
    return json.dumps({"version": "1.0", "mode": "production"})

Step 6: Test

# Test with MCP inspector
npx @modelcontextprotocol/inspector python server.py

# Or test tools directly
python -c "from server import *; print(get_weather('London'))"

Step 7: Configure for Use

Add to the LLM host's MCP configuration (e.g., `claude_desktop_config.json`):

{
  "mcpServers": {
    "my-service": {
      "command": "python",
      "args": ["path/to/server.py"],
      "env": {
        "API_KEY": "your-key-here"
      }
    }
  }
}

Best Practices

  • **Descriptive tool names** - `search_emails` not `search`, `create_calendar_event` not `create`
  • **Detailed descriptions** - Include when to use the tool, what it returns, and limitations
  • **Type everything** - Use proper types for all parameters and returns
  • **Error handling** - Return helpful error messages, never crash the server
  • **Idempotency** - Tools should be safe to retry
  • **Minimal permissions** - Only request the access you need
  • **Logging** - Log tool calls for debugging (to stderr, not stdout)
Read more
Ships withhermes-desktop

A Windows-native AI agent that lives on your desktop. Chat with it, give it tools, let it learn who you are. Built with WinUI 3 and .NET 10.

Get the whole plugin

Other skills on hermes-desktop.