MCP Protocol Explained: Make Any API Claude-Compatible in 10 Minutes

Dev.to / 4/14/2026

💬 OpinionDeveloper Stack & InfrastructureSignals & Early TrendsTools & Practical Usage

Key Points

  • MCP (Model Context Protocol) enables Claude—and other MCP-compatible AI agents—to directly call external APIs rather than only generating instructions based on documentation.
  • The article demonstrates a minimal MCP server setup that registers API “tools” with input schemas so the model can invoke them programmatically.
  • It highlights the workflow impact: direct API calling allows automated actions based on API responses, not just text output.
  • A simple example tool, `calculate_ai_cost`, shows how to expose business logic to an AI agent through MCP.

MCP (Model Context Protocol) is the standard that lets Claude — and any MCP-compatible AI — talk directly to your APIs. Here's how to make your API Claude-compatible in 10 minutes.

What MCP Actually Does

Without MCP: Claude can read text about your API and suggest curl commands.
With MCP: Claude can call your API directly, read the response, and take action.

The difference is huge for automation workflows.

The Minimal MCP Server

# mcp_server.py
from mcp.server import Server
from mcp.server.stdio import stdio_server
from mcp.types import Tool, TextContent
import requests

server = Server("my-api-mcp")

@server.list_tools()
async def list_tools():
    return [
        Tool(
            name="calculate_ai_cost",
            description="Calculate the cost of an AI API call",
            inputSchema={
                "type": "object",
                "properties": {
                    "model": {"type": "string"},
                    "input_tokens": {"type": "integer"},
                    "output_tokens": {"type": "integer"}
                },
                "required": ["model", "input_tokens", "output_tokens"]
            }
        )
    ]

@server.call_tool()
async def call_tool(name: str, arguments: dict):
    if name == "calculate_ai_cost":
        resp = requests.get("https://api.lazy-mac.com/ai-spend/calculate", params=arguments)
        return [TextContent(type="text", text=str(resp.json()))]

async def main():
    async with stdio_server() as (read, write):
        await server.run(read, write, server.create_initialization_options())

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

Wire it to Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "my-api": {
      "command": "python3",
      "args": ["/path/to/mcp_server.py"]
    }
  }
}

Restart Claude Desktop. Now you can say: "Calculate the cost of 10,000 GPT-4o calls with 500 input and 200 output tokens each" — and Claude just does it.

Why This Matters for Revenue

MCP-compatible APIs are listed in directories like Smithery and MCPize. That's additional discovery surface on top of RapidAPI and Gumroad.

I have 24 APIs registered on MCPize. Zero additional code — just register the endpoint URL.

MCP-compatible API hub | All APIs on Gumroad