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
Claude Code's --worktree Now Accepts a GitLab Merge Request URL Directly, No Number Conversion Needed  ·  Claude Code Remote Control Now Streams Live: Every Foreground Subagent Tool Call, Visible on Your Phone  ·  Claude Code Adds PreModelSwitch/PostModelSwitch Hooks: Switching Models Can Finally Be Intercepted and Logged  ·  Claude Code's New /design Skill: Turn a Screenshot or an Idea Into an Editable Interface  ·  Claude Code's Auto Mode Became the Default on 8/14, and Its Rules Are Now Written as Plain Sentences  ·  Claude Code's New Feature: It Drafts Its Own Feedback Report When Something Goes Wrong, and You Decide Whether to Send It
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
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
Claude Batch API in Practice: How to Cut Costs in Half on Bulk Tasks
tools · Jun 17
Related News
More Related Topics
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
How to Run Your First Crypto Agent: A Complete Beginner's Guide, and the Mistakes Most People Make
AI Agent Bible
The most common mistake running your first Crypto Agent isn't wrong code — it's giving the Agent too much authorization from the start. Real main wallet, no amount limits, skipping testnet: all three together is a recipe for regret. Read first, test next, real money last.
#automation#claude-code
What an Agent Task Really Costs: A Complete Cost Structure Breakdown, and Why Most People Underestimate It
AI Agent Bible
An auto-rebalancing DeFi Agent can cost $50–300 per month — but most people only count LLM API fees, forgetting tool call costs, Gas fees, and the fact that Gas can be 100x normal during network congestion. The Agent's gains must cover all three cost layers. Otherwise it's just a more expensive way to automate losses.
#automation#claude-code
What Is an On-Chain Agent? It Differs from Every AI Tool You've Used in One Key Way
AI Agent Bible
An on-chain Agent differs from every AI tool you've used in one thing: it can self-sign on-chain transactions and operate crypto protocols without your step-by-step confirmation. Your assets can be moved while you sleep — which is exactly why it's both powerful and dangerous.
#automation#claude-code