MCP Servers Explained: Connect AI Agents to Any Tool or API (2026)
The Model Context Protocol (MCP) is an open standard (originated by Anthropic in November 2024, now open and community-governed) that lets AI assistants like Claude call external tools, read resources, and use reusable prompts. Instead of hardcoding integrations, you run MCP servers, lightweight processes that expose capabilities over a simple protocol. Claude (Desktop and Code), ChatGPT, VS Code, Cursor, and many other MCP hosts connect to these servers, so your AI can scrape the web, query databases, or run APIs on your behalf. Think of MCP as a USB-C port for AI: one standard plug instead of a custom cable per integration. Explore the Apify MCP server.
What MCP Is
MCP defines how AI applications (the host) communicate with external services (the server). The host sends requests; the server executes tools, returns resources, or invokes prompts. The protocol is transport-agnostic: stdio for local processes, and remote Streamable HTTP (which replaced the older HTTP+SSE transport) for hosted services. Any client that supports MCP can use any MCP server.
This decoupling is the main advantage over traditional function calling: you don't ship tool definitions in each application. You run one MCP server, and every compatible host (Claude Desktop, Cursor, your own app) can use it.
Architecture: Host ↔ Server ↔ Resources
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ MCP Host │ JSON │ MCP Server │ │ External APIs │
│ (Claude, │ ←───→ │ (your tool │ ──────→ │ Apify, DB, │
│ Cursor) │ RPC │ or service) │ │ etc. │
└─────────────────┘ └─────────────────┘ └─────────────────┘
The host connects to the server over stdio or HTTP. When you ask Claude to "scrape this URL," the host calls the server's run_actor tool (or equivalent). The server runs the Apify Actor, fetches results, and returns them. The host injects that context back into the conversation.
Three MCP Primitives
| Primitive | Purpose | Example |
|---|---|---|
| Tools | Function calls the AI can invoke | run_actor, get_weather, search_postgres |
| Resources | Read-only context (URIs, content) | file:///path/to/doc, apify://actor/run/dataset |
| Prompts | Reusable prompt templates | "Summarize this markdown," "Generate a scraper" |
Tools are the most common. The AI sees the tool schema (name, description, parameters) and decides when to call it. Resources let the AI pull in documents or data by URI without an explicit tool call. Prompts standardize common workflows so users can trigger them with one click.
How MCP Differs from Function Calling
| Attribute | MCP Servers | OpenAI Function Calling | LangChain Tools |
|---|---|---|---|
| Connection | Persistent, bidirectional | Per-request, stateless | Per-chain, in-process |
| Client flexibility | Any MCP host uses any server | Tied to OpenAI SDK | Tied to LangChain |
| Discovery | Server advertises at connect | Defined per app | Defined per chain |
| Deployment | Run as separate process | Inline in code | Inline in code |
MCP is designed for tool as a service: you deploy a server once, and multiple applications can use it. OpenAI's function calling is request-scoped: you pass tool definitions with every API call. LangChain tools live inside your Python or JS process. MCP sits in the middle: shared, persistent, and protocol-based. Worth noting, OpenAI's own platform now supports MCP too, so the line between these approaches is blurring.
Building an MCP Server
Use the official SDKs:
- TypeScript/Node:
@modelcontextprotocol/sdk - Python:
mcppackage
A minimal server exposes one or more tools. Here's a TypeScript example with a get_weather tool:
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new McpServer({ name: "weather-server", version: "1.0.0" });
server.tool("get_weather", "Get current weather for a city", {
city: { type: "string", description: "City name" },
}, async ({ city }) => {
const res = await fetch(`https://api.example.com/weather?city=${city}`);
const data = await res.json();
return { content: [{ type: "text", text: JSON.stringify(data) }] };
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
}
main();
Run with node server.js. Add to Claude's MCP config:
{
"mcpServers": {
"weather": {
"command": "node",
"args": ["/path/to/server.js"]
}
}
}
Claude can now call get_weather when you ask about the weather.
Popular MCP Servers in 2026
| Server | Capability | Use Case |
|---|---|---|
| Apify | Run Actors, read datasets | Web scraping, data extraction |
| Firecrawl | Scrape URLs to markdown | RAG, content ingestion |
| Bright Data | Proxy + Scraping Browser | Anti-bot sites |
| GitHub | Repos, issues, PRs | Code assistant |
| Postgres | Query database | Data analysis |
| Filesystem | Read/write local files | Doc editing, config |
The Apify MCP server is especially useful for AI-driven scraping: Claude can trigger Actors, wait for results, and feed data into the conversation. Apify offers two ways to connect: a hosted server at https://mcp.apify.com/?fpr=use-apify (OAuth-based, recommended, exposes 30,000+ Actors) or a local server via npx -y @apify/actors-mcp-server. See Apify Claude Desktop MCP for setup. If you want to follow along hands-on, you can try Claude free for a week and wire up your first server.
Comparison: MCP vs OpenAI Function Calling vs LangChain Tools
| Attribute | MCP | OpenAI Function Calling | LangChain Tools |
|---|---|---|---|
| Scope | Cross-application, shared | Per-request | Per-chain |
| Persistence | Long-lived server | Stateless | In-process |
| Ecosystem | Growing (Claude, Cursor, etc.) | OpenAI-only | LangChain-only |
| Setup | Separate process, config | SDK + schema | Python/JS imports |
| Best for | Claude, multi-app tooling | ChatGPT apps | Python pipelines |
Use MCP when you want Claude (or similar) to access tools without rebuilding them into each app. Use OpenAI function calling for ChatGPT-specific integrations. Use LangChain tools when you're already in a LangChain pipeline.
Transport Options: stdio vs HTTP
MCP servers can run locally (stdio) or remotely (Streamable HTTP). For local setups, stdio is the default: the host spawns the server as a subprocess and communicates via stdin and stdout. For remote servers, the current spec uses Streamable HTTP (the older HTTP+SSE transport still exists in some servers but is being phased out) so the host can connect to a URL. Remote servers enable sharing a single deployment across multiple users or applications. When building custom servers, start with stdio for simplicity, then move to remote HTTP when you need centralized deployment or cross-machine access.
Integrating with Apify
The Apify MCP server exposes tools like run_actor and get_dataset. Claude can run the Website Content Crawler, Google Search Scraper, or any custom Actor. Results are returned as context for the next turn. This pairs well with Firecrawl MCP for hybrid workflows: Firecrawl for quick markdown, Apify for complex crawls and custom logic.
Add the Apify or Firecrawl MCP server first. Get comfortable with tool calls and resources, then build a custom server for your own APIs.
The Model Context Protocol (MCP) is Anthropic's open standard for connecting AI assistants to external tools. MCP servers expose tools, resources, and prompts that hosts like Claude Desktop can call.
Add a server entry to Claude's MCP config (claude_desktop_config.json or Cursor settings). Specify command and args for local stdio servers, or a URL for remote Streamable HTTP servers. In Claude Desktop you can also add remote servers through the connectors UI.
MCP uses persistent servers that any MCP host can use. OpenAI function calling is per-request and tied to the OpenAI API. MCP is more reusable across applications.
Yes. Use the mcp Python package. Define tools with @server.tool decorator, implement handlers, and run with stdio or HTTP transport.
The official Apify MCP server lets Claude run Actors and read datasets. You can also build custom MCP servers that call the Apify API.
Yes. Cursor supports MCP servers. Configure them in Cursor settings. Many MCP servers (Apify, Firecrawl, Filesystem) work with both Claude Desktop and Cursor.




