Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Exploring the Frontier of AI Intelligence
claude-me.com
LATEST
Eight Principles Straight From Anthropic: If Claude Keeps Getting Worse, the Problem Is Probably How You're Using It  ·  Claude Code Can Now 'Loop' Through Work on Its Own: Anthropic Releases Four Loop Mode Guide That Lets AI Run Entire Processes  ·  Claude Cowork Honest Review: Three Months Later — What Actually Saved Time, What Made Me Regret Automating It  ·  Two Major Stories to Open July: Claude Sonnet 5 Launches, Fable 5 Export Controls Lifted and Globally Restored  ·  What Is RAG: Why Claude Can't Read Your Company Intranet — And How to Fix That  ·  Claude Cowork Advanced Workflows: From 'Hand Off One Task' to 'Run an Entire Process' — Three Real-World Templates
mcp

MCP for Developers: Build Your First MCP Server from Scratch

30-Second Version · For the impatient
Building an MCP Server doesn't require you to be a senior engineer — 30 lines of Python lets Claude call your internal API and operate your systems with natural language.

Full Explanation +
01 · Why did this happen?

You'd typically build your own MCP Server when you have internal tools or APIs with no ready-made Server, or when you want to expose your own service to Claude. An MCP Server's core structure: declare tools (tell Claude what it can do), receive requests (when Claude calls your tool), execute operations and return results. Using Anthropic's official Python SDK, a minimal working MCP Server requires only about 30-50 lines of code.

02 · What is the mechanism?

MCP Server development has a lower barrier than traditional API integration because the MCP protocol standardizes "the communication format between AI and tools" — you don't need to write a separate integration for each AI application. Just build one MCP Server and all MCP-supporting AI applications can use it. This "write once, use everywhere" characteristic makes MCP Server investment returns far exceed traditional API integration, which is why the MCP ecosystem could expand so rapidly in 2025.

03 · How does it affect me?

The most direct developer impact: MCP enables you to integrate Claude's capabilities into any API-connected system with dramatically lower integration cost than traditional approaches. A practical scenario: if your company has an internal knowledge base, CRM, or work management system, after building an MCP Server, employees can query and operate these systems directly through natural language — without learning each system's interface. This "operate any system with natural language" capability is one of AI tools' highest-productivity-impact applications for enterprises.

04 · What should I do?

Fastest path to building your first MCP Server: (1) find an existing Server in github.com/modelcontextprotocol/servers that's closest to your needs and use its code as a starting point; (2) install pip install mcp httpx; (3) replace the Server's tool names and descriptions with yours; (4) replace the logic in call_tool with calls to your API; (5) add to Claude Desktop config, test. Start with one tool, confirm the basic flow works, then gradually add more tools.

Full Content +

If you already understand MCP concepts (if not, read the "What Is MCP" article first), this article takes you to the next step: building your own MCP Server to connect your internal tools or custom systems to Claude.

When Building Your Own Server Makes Sense

The official and community MCP Server directory already has over 1,000 ready-made Servers covering most major tools. You'd typically build your own when: you have internal custom tools with no existing Server; existing Servers don't meet your requirements (specific auth methods, specific data formats); you want to expose your service to Claude.

MCP Server Basic Architecture

An MCP Server implements the MCP protocol, doing three things:

  1. Declare Tools: tell Claude "what I can do"
  2. Receive Requests: receive Claude's tool calls
  3. Execute and Return Results: perform the actual operation, return results to Claude

Build a Minimal Working MCP Server in Python

Here's a minimal weather-querying MCP Server using Anthropic's official Python SDK:

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

app = Server("weather-server")

@app.list_tools()
async def list_tools() -> list[types.Tool]:
    return [
        types.Tool(
            name="get_weather",
            description="Get current weather for a city",
            inputSchema={
                "type": "object",
                "properties": {
                    "city": {"type": "string", "description": "The city name"}
                },
                "required": ["city"]
            }
        )
    ]

@app.call_tool()
async def call_tool(name: str, arguments: dict) -> list[types.TextContent]:
    if name == "get_weather":
        city = arguments["city"]
        async with httpx.AsyncClient() as client:
            geo = await client.get(
                f"https://geocoding-api.open-meteo.com/v1/search?name={city}&count=1"
            )
            results = geo.json().get("results", [])
            if not results:
                return [types.TextContent(type="text", text=f"City not found: {city}")]
            lat, lon = results[0]["latitude"], results[0]["longitude"]
            weather = await client.get(
                f"https://api.open-meteo.com/v1/forecast?"
                f"latitude={lat}&longitude={lon}&current=temperature_2m"
            )
            temp = weather.json()["current"]["temperature_2m"]
            return [types.TextContent(type="text", text=f"{city}: {temp}°C")]
    return [types.TextContent(type="text", text="Unknown tool")]

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

Install dependencies: pip install mcp httpx

Add to Claude Desktop config (claude_desktop_config.json):

{
  "mcpServers": {
    "weather": {
      "command": "python",
      "args": ["/path/to/weather_server.py"]
    }
  }
}

Restart Claude Desktop and ask: "What's the Temperature in Taipei?" — Claude will call your Server.

Key Design Principles

Minimum privilege: only expose operations that are actually needed. Read-only where possible.

Clear tool descriptions: the description field is critical — Claude decides when to call the tool based on this. Clearer description = higher calling accuracy.

Error handling: provide explicit error responses for all failure modes, not empty results that leave Claude guessing.

Consider reversibility: for state-changing operations (delete, update, send), consider adding confirmation mechanisms or operation logs at the Server layer.

Diagram
MCP Server 架構:你的代碼如何成為 Claude 能呼叫的工具架構圖呈現 MCP Server 的三層結構:Claude(呼叫端)→ MCP Protocol(通訊標準)→ 你的 Server(工具宣告 + 執行邏輯)→ 外部 API / 資料庫(實際操作),說明每一層的職責和信息流向。MCP Server Architecture — How Your Code Becomes a Claude ToolClaudeMakes tool callsGets resultsMCP ProtocolStandard formatJSON-RPC messagesYour MCP Serverlist_tools()Declares what Claude can callname + description + schemacall_tool()Receives Claude's callExecutes logic, returns resultYour business logicCall internal APIsQuery databasesRun scriptsExternalYour APIDatabaseResultsJSON / TextBack to ClaudeKey insight: Your Server is the bridge between Claude's natural language and your systemsClaude says "get customer info" → MCP calls your tool → your code queries CRM → result back to Claude → Claude responds naturallyClaude Me · claude-me.com
Feel free to share. Please credit the source.
Ask a Question
Please enter at least 10 characters
Related Articles
MCP vs Direct Claude API: What Is the Difference and When to Use Which
mcp · Jun 17
Build Your Own MCP Server: Safely Connect Claude to Your Internal Tools (With Permissions and Debugging)
mcp · Jun 15
Notion MCP in Practice: Once Set Up, Claude Reads and Writes Your Notion — Manage Your Knowledge Base in Natural Language
mcp · Jun 29
MCP in Practice: After Setting Up Google Drive MCP, Claude Reads Your Files Directly — No Copy-Pasting Required
mcp · Jun 26
Related News
More Related Topics
Content Repurposing Workflow: Using Claude to Turn One Core Piece Into Five Platform-Ready Versions Automatically
Claude Cowork Me
The most time-consuming part of content repurposing isn't the writing — it's switching between different output modes. Claude handles format conversion; you handle insights and creativity. That's the right division.
#automation#claude-code
Daily Work Briefing Automation: Let Claude Organize Everything That Matters Today Before You Even Start Working
Claude Cowork Me
Spending 15 minutes every morning organizing 'what to do today' is actually a hidden work cost. Claude scheduling automates this — you open your computer, and today's priorities are already organized, so you can start executing immediately.
#automation#claude-code
Weekly Report Automation: Turn Your Most Painful 30 Minutes Into a 3-Minute Paste-and-Done
Claude Cowork Me
The most painful thing about weekly reports isn't not knowing what to write — it's doing the same formatting job every single week. Separate capture from formatting: you record, Claude formats. 30 minutes becomes 3.
#automation#claude-code
Tool Use Mechanism Complete Breakdown: How AI Agents 'Act,' and Why This Design Determines Whether They Can Be Trusted
AI Agent Bible
An AI Agent's LLM doesn't actually execute any tool — it only outputs 'I want to do this' requests; your backend code does the real execution. This design is the foundation of all security: the execution layer is under your control, and security validation is added there. How well tools are designed determines whether an Agent can be trusted.
#automation#claude-code