Mcp builder

From Kxiandaoyan/Memoh-v2 · View interactive version

Mcp builder is an AI agent skill from the GitHub repository Kxiandaoyan/Memoh-v2. Build Model Context Protocol (MCP) servers that expose tools, resources, and prompts to AI agents. Use when asked to create an MCP server, add new tools to an existing MCP, or integrate external APIs as MCP tools.

How to use this skill

Skill file

MCP Builder

Create Model Context Protocol (MCP) servers to expose tools and resources to AI agents.

MCP Concepts

Quick Start (Python)

from mcp.server import Server
from mcp.server.stdio import stdio_server
from mcp import types

server = Server("my-server")

@server.list_tools()
async def list_tools() -> list[types.Tool]:
    return [
        types.Tool(
            name="my_tool",
            description="What this tool does and when to use it",
            inputSchema={
                "type": "object",
                "properties": {
                    "param": {"type": "string", "description": "Parameter description"}
                },
                "required": ["param"]
            }
        )
    ]

@server.call_tool()
async def call_tool(name: str, arguments: dict) -> list[types.TextContent]:
    if name == "my_tool":
        result = do_something(arguments["param"])
        return [types.TextContent(type="text", text=str(result))]
    raise ValueError(f"Unknown tool: {name}")

async def main():
    async with stdio_server() as streams:
        await server.run(*streams, server.create_initialization_options())

if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

Tool Design Guidelines

Common Patterns

API wrapper

Wrap REST APIs as MCP tools. Handle auth, rate limits, and error responses gracefully.

File operations

Expose read/write/list operations scoped to a safe directory.

Database queries

Wrap SQL queries with parameterized inputs to prevent injection.

Testing

# Run server directly
python server.py

# Test with MCP inspector
npx @modelcontextprotocol/inspector python server.py
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.