MCP

What the Model Context Protocol is, popular open-source MCP servers, and how to build one.

MCP

What is MCP

MCP (Model Context Protocol) is an open standard, introduced by Anthropic in late 2024, for connecting AI agents to external tools and data. Think of it as “USB-C for AI”: instead of every agent writing a bespoke integration for every service, a tool exposes itself once as an MCP server, and any MCP client (Claude Code, Cursor, Copilot, …) can use it.

It’s a client–server protocol (JSON-RPC over stdio or HTTP). A server can expose three kinds of capability:

  • Tools — actions the model can invoke (query a DB, create an issue).
  • Resources — data the model can read (files, records, docs).
  • Prompts — reusable prompt templates the user can trigger.

The win is decoupling: build an integration once, use it from any agent.

A few widely used, open-source servers to get started with:

  • Filesystem — read/write local files within allowed paths.
  • Git / GitHub / GitLab — inspect repos, manage issues and PRs.
  • Postgres / SQLite — run queries against a database.
  • Fetch — retrieve and convert web pages to text.
  • Puppeteer / Playwright — drive a real browser for testing and scraping.
  • Slack — read and post messages.
  • Memory — a persistent knowledge graph across sessions.

The reference servers live in the official repo, and the community has built hundreds more (cloud providers, search, monitoring, etc.).

Developing an MCP server

The fastest path is an official SDK — Python (FastMCP) or TypeScript. A minimal Python server:

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("demo")

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b

if __name__ == "__main__":
    mcp.run()   # speaks MCP over stdio

The steps are:

  1. Create the server and declare tools (functions), resources, and prompts — docstrings and type hints become the schema the model sees.
  2. Pick a transport: stdio for local tools, HTTP for remote/shared servers.
  3. Register it with your client (e.g. an .mcp.json entry or claude mcp add).

Clear tool names, tight descriptions, and small focused tools matter more than quantity — that’s what lets the model pick the right action reliably.


Resources

https://modelcontextprotocol.io/

https://github.com/modelcontextprotocol/servers

https://github.com/modelcontextprotocol/python-sdk

Designed by Canux