Model Context Protocol (MCP) is the open standard from Anthropic that enables AI models to connect to any data source or tool through a universal integration interface — the USB-C of AI connectivity. Published in November 2024 and adopted by Claude, OpenAI, Google Gemini, and all major AI coding tools within months, MCP has become the integration standard that eliminates bespoke AI-to-tool connectors. This guide covers the MCP architecture, building MCP servers, and the enterprise integration patterns that deliver production value.
What Is MCP?
MCP Architecture
- The AI application that manages connections — Claude Desktop, Claude Code, Cursor, VS Code
- Maintains connections to one or more MCP servers simultaneously
- Exposes MCP capabilities to the AI model as available tools
- A program (TypeScript, Python, Go, Rust) that exposes Resources, Tools, and Prompts
- Can wrap any API, database, file system, or service
- Runs locally (stdio) or remotely (HTTP/SSE) — both supported
- Data the model can read — identified by URI
- Examples: git repository files, database records, Confluence pages, Slack messages
- Can be static or dynamic (computed at read time)
- Functions the model can invoke — with JSON schema input/output
- Examples: create_issue, send_email, query_database, run_test
- Model calls tools based on reasoning about the task at hand
Building an MCP Server (TypeScript)
Install the official SDK: npm install @modelcontextprotocol/sdk. Use the TypeScript starter template from github.com/modelcontextprotocol/create-typescript-server: npx @modelcontextprotocol/create-server my-server. This scaffolds a working MCP server with the connection lifecycle, error handling, and tool/resource patterns. The server.ts file is where you add your specific tools and resources. Build with npm run build; test locally with the MCP Inspector: npx @modelcontextprotocol/inspector dist/server.js.
Add a tool using server.tool(name, description, inputSchema, handler). The inputSchema is a Zod schema — the MCP host uses this to validate inputs and generate UI. The handler function receives validated inputs and returns a result. Add a resource using server.resource(name, description, uri, handler). Resources are read-only data; tools have side effects. Define clear, descriptive tool names and descriptions — the AI model uses them to decide which tool to call.
Claude Desktop: add your server to ~/Library/Application Support/Claude/claude_desktop_config.json under "mcpServers". Claude Code: use claude mcp add my-server node /path/to/dist/server.js. Restart the host to pick up the new server. Test by asking the AI to use one of your tools. For remote (HTTP) servers, deploy as a standard Node.js service and configure the URL in the MCP host. Integrate into your deployment pipeline for enterprise server management.
Our software development and API integration teams build custom MCP servers that connect enterprise systems — ERP, CRM, data warehouses, internal APIs — to AI tools across your engineering organisation. Book a free advisory session.