0
Phase 7

MCP Server

~3 min read

Concept & How It Works

    Why Does It Exist?

    Building an MCP server once lets every MCP-compatible client (Cursor, Claude Desktop, custom agents) use your integration without per-app code.

    Real-World Analogy

    An MCP server is a power adapter — it converts your service's native API into the standard MCP plug that any client can use.
    Loading diagram...

    Visual Workflows

    What is MCP Server?

    Loading diagram...

    Example

    Scenario

    A Jira MCP server exposes create_ticket, search_issues, and add_comment tools, plus a resource for reading project configs.

    Solution

    In Model Context Protocol, apply MCP Server to this scenario: A Jira MCP server exposes create_ticket, search_issues, and add_comment tools, plus a resource for reading project configs. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

    Practice Task

    Do this before moving to the next module — reading alone is not enough.

    Open the Code Walkthrough below and run it locally. Change one parameter related to MCP Server (e.g. model, temperature, top_k, or tool name), observe the difference in output, and write 2–3 sentences explaining what changed.

    Code Walkthrough

    Highlighted lines show where MCP Server happens in the code.

    MCP Server
    1from mcp.server import Server  # import dependencies2from mcp.types import Tool, TextContent  # import dependencies3
    4server = Server("my-server")  # key line for MCP Server5
    6@server.list_tools()  # key line for MCP Server7async def list_tools():8    return [Tool(name="greet", description="Greet a user", inputSchema={  # return the result9        "type": "object", "properties": {"name": {"type": "string"}}, "required": ["name"]10    })]11
    12@server.call_tool()  # key line for MCP Server13async def call_tool(name, arguments):14    if name == "greet":15        return [TextContent(type="text", text=f"Hello, {arguments['name']}!")]  # return the result

    Commands to Remember

    Commands to Remember

    • npx @modelcontextprotocol/inspector # debug MCP servers interactively
    • pip install mcp # Python MCP SDK
    • uvx mcp-server-filesystem # run a filesystem MCP server

    Common Mistakes

    • Treating MCP Server as a black box without evaluation
    • Ignoring cost and latency in production
    • Skipping error handling for mcp server

    Cheat Sheet

    Quick recap — the most important points from this module.

    Cheat Sheet

    quick ref
    • MCP Server
    • Server SDK
    • call_tool
    • TextContent