GLITCHiT executed deep research to develop a comprehensive white paper demonstrating how AI agents and multi-agent systems can transform NHS GP triage and diagn…
Notebook
What Problem Does MCP Solve
MCP is an open standard that creates a bridge between AI assistants (particularly Large Language Models) and the systems where data actually lives—including con…
But First a Reminder: What is Model Context Protocol?
MCP is an open standard that creates a bridge between AI assistants (particularly Large Language Models) and the systems where data actually lives—including content repositories, business tools, development environments, and databases. Think of it as a “USB-C port for AI”—providing a universal connector that standardises how AI models receive information from and interact with external systems.
The protocol addresses a fundamental limitation of even advanced AI models: their isolation from real-time data and inability to interact with external systems in a standardised way. Before MCP, developers had to build custom integrations for each data source an AI model needed to access, creating a fragmented ecosystem of connectors.
Core Components of MCP
MCP architecture consists of two main elements:
- MCP Servers: Components that expose data and functionality to AI models
- MCP Clients/Hosts: AI interfaces (like Claude Desktop) that connect to these servers
Key Features of MCP
MCP introduces three primary interfaces for AI-data interaction:
- Tools: Functions the model can call with user approval (similar to APIs) to perform actions like searching data, creating tickets, or updating records
- Resources: File-like data the model can read, such as documents, wikis, or databases
- Prompts: Reusable templates defined by servers that help standardise common interactions
It Fixes Integration Complexity and Data Silos
The most significant challenge MCP addresses is fragmented data and systems integration:
- 42% of enterprises need access to eight or more data sources to deploy AI agents successfully
- 69% of European businesses cite data integration as a major challenge for AI adoption
- 94% of organisations struggle to integrate data across systems, with only 32% of applications typically connected
- 90% of businesses agree that data silos create business challenges
MCP provides a “universal connector” that standardises how AI models receive information from and interact with external systems, replacing multiple custom integrations with a single protocol.
MCP Simplifies Maintenance and Updates
MCP enables modular, efficient updates across AI implementations:
- When policies or information change, only specific context layers need updating, with changes automatically propagating across all connected applications
- This “compartmentalisation helps large enterprises maintain consistent, up-to-date responses across diverse user segments”
- Organisations avoid creating “tomorrow’s technical debt” by eliminating patchwork integration approaches
Security and Standardisation
MCP addresses critical security concerns while providing standardisation:
- Security issues are the top challenge cited by both leadership (53%) and practitioners (62%)
- MCP implements standardised access controls and ensures consistent security practices across tools
- It sets “a standard for how AI applications are built and a clear way to develop AI and agentic behaviour when exchanging data across projects and applications”
Real-Time Context Awareness
AI agents need current, accurate information to be effective:
- MCP enables “real-time, bidirectional communication between AI models and tools”
- It provides “live data updates instead of static connections”
- This improves contextual awareness as “LLMs can access a wider range of data, leading to more accurate and relevant responses”
Development Efficiency and Scalability
MCP significantly reduces development burdens:
- “Developers no longer need to build custom integrations for each data source”
- It simplifies debugging and troubleshooting
- MCP makes it easier to “connect LLMs to a large number of data sources, improving scalability”
By addressing these interconnected challenges, MCP enables businesses to deploy AI agents more effectively across their organisation while avoiding the fragmentation, security issues, and maintenance burdens that typically accompany enterprise-wide AI implementations.
What Did We Do Before MCP?
In Absence of MCP
Before MCP (Model Context Protocol), enterprises implementing AI agents have had to consider several approaches for data integration and system connectivity architecture.
Custom API Integrations
Traditional API integrations would be the primary alternative, requiring:
- Custom development work for each data source and system connection
- Dedicated integration architecture to handle data flow between AI agents and enterprise systems
- Maintenance overhead as each integration would need independent updates and security management
“Integrations are not merely a way to access data for AI agents; they are critical to enabling these agents to take meaningful actions on behalf of other applications”.
Enterprise AI Agent Builders
Several platforms could help manage the complexity of agent development and integration:
- Google’s Vertex AI Agent Builder: Offers “seamless integration with Google Cloud services” and “scalable infrastructure for handling large datasets”
- Microsoft Copilot Studio: Provides “no-code development environment” with “integration with Microsoft Teams, Dynamics 365, and Power BI”
- Stack AI: A “versatile and powerful interface to deploy AI Agents for Enterprise AI” with “drag-and-drop no-code” capabilities
AI Agent Frameworks
Open-source frameworks that provide integration capabilities:
- LlamaIndex: “Designed to streamline complex data integration and retrieval for AI agents”
- LangChain, Semantic Kernel, CrewAI, or Autogen: These “offer diverse capabilities for businesses” and “address different” integration needs
- CrewAI: A “Multi-Agent Platform” that can “streamline workflows across industries with powerful AI agents”
Multi-Agent Management Solutions
For enterprises deploying multiple AI agents:
- Workday: Recently launched “a platform to help enterprises manage a fleet of AI agents in a central place”
- Unily Insight Centre: Offers a “world-first bring-your-own AI agent capability” for “enterprises to integrate, manage and interact with the digital assistants of their choice”
Enterprise-Grade Integration Platforms
Specialised solutions for complex integration scenarios:
- Mulesoft: “Excels in enterprise-grade API management and comprehensive integration solutions, ideal for large organisations seeking robust, scalable systems”
- IBM AI Integration Services: Designed “to help clients transform end-to-end business processes with agentic AI on their preferred” platforms
Security and Deployment Considerations
Without MCP’s standardised approach, you’d need to address:
- Deployment flexibility: You would need to consider solutions like SmythOS that offer “various deployment options and data formats”
- Security infrastructure: Look for platforms providing “robust security features including data encryption, OAuth support, and IP control”
- Data sovereignty: Some solutions like Rasa support “on-premises deployment, making it attractive to industries with strict data sovereignty requirements”
Without MCP’s standardized protocol, enterprises would face greater complexity in creating a cohesive AI agent ecosystem, requiring more custom development work and careful architecture planning to ensure security, scalability, and interoperability across systems.
AI Agents and Model Context Protocol (MCP)
So we have learnt that MCP represents a significant advancement in how artificial intelligence systems interact with external data sources and tools all in realtime.
Benefits of Using MCP
The standardised approach of MCP offers several key advantages:
- Universal Access: Provides a single protocol for AI to access diverse data sources
- Standardised Connections: Replaces custom API connectors with a secure, uniform protocol
- Simplified Development: Reduces the need to create and maintain separate integrations for each data source
- Enhanced Context Awareness: Enables AI to ground responses in accurate, up-to-date information
- Reusability: Allows developers to build MCP servers once and use them across multiple AI applications
MCP and AI Agents
AI agents are autonomous systems that can perceive their environment, make decisions, and take actions to achieve specific goals. MCP significantly enhances the capabilities of AI agents in several ways:
1. Enhanced Contextual Understanding
MCP allows AI agents to access real-time information from various sources, improving their contextual understanding and enabling more accurate responses. Rather than relying solely on training data, agents can retrieve current information before formulating responses.
2. Tool Usage and Function Calling
Through MCP, AI agents can discover and utilise tools exposed by servers. This enables agents to:
- Execute specific functions like retrieving weather forecasts
- Query databases for information
- Interact with business systems
3. Building Effective Agents
Frameworks like mcp-agent leverage MCP to create more powerful AI agents by:
- Managing the lifecycle of MCP server connections
- Implementing composable patterns for agent development
- Supporting programmatic control flow for complex workflows
4. Agent-Led Integrations
As AI agents become more sophisticated, they can autonomously analyse tasks and discover appropriate tools via MCP. For example, an agent might:
-
Analyse a coding task
-
Consult a Git repository through an MCP server
-
Update a ticket management system
-
Log results in Slack
All through standardised MCP connections rather than custom integrations.
While MCP offers significant advantages over traditional APIs for AI agent integration, it’s not always the right choice for every scenario. Let me break down when you should consider each approach:
When MCP Is Advantageous
For multiple integrations: MCP truly shines when your agent needs to connect to several different systems. Instead of writing separate API integrations for each service, you can use the standardised MCP protocol.
For dynamic discovery and flexibility: MCP allows AI agents to discover and interact with available tools without hardcoded knowledge of each integration. This makes your agent more adaptable
For real-time, two-way communication: MCP supports persistent connections similar to WebSockets, enabling both data retrieval and action triggering in real-time.
For rapid development: With over 1000 MCP servers already available, you can quickly add capabilities to your agent without custom integration work.
For scalability: MCP makes it easy to expand your agent’s capabilities—simply connect another MCP server without rewriting existing integrations.
When Traditional APIs Might Be Better
For precise control: If your use case demands precise, predictable interactions with strict limits, traditional APIs could be preferable.
For performance optimisation: Manual API integration often results in higher accuracy and performance, as you’re not limited by the abstractions imposed by MCP.
For highly specialised functionality: When you need fine-grained control and highly-specific, restricted functionalities.
For maximum predictability: When you want tight coupling for performance optimisation and minimal context autonomy.
Practical Consideration
A balanced approach might be best for many agent builders. Consider using MCP for:
- Quick prototyping
- General-purpose integrations
- When accessing multiple systems
- Where standardisation benefits outweigh customisation needs
And stick with direct API integration when:
- You need absolute control over the integration
- Performance is critically important
- The specific API has features not well-supported by existing MCP servers
Rather than viewing it as an either/or decision, consider your specific requirements for each integration point in your agent architecture.
How Can AI Agents Leverage MCPs
Tools: Flight Assistance Agent
An airline customer service AI agent could be designed to leverage MCP Tools to handle passenger enquiries and travel disruptions:
Design approach:
- The agent connects to multiple airline systems via MCP servers including the booking system, baggage handling, and flight status databases
- When a passenger messages “My flight to Manchester has been cancelled, what are my options?”, the agent would:
- Identify this as requiring the flight rebooking tool
- Request the passenger’s permission to access their booking details
- Upon approval, call the flight search tool to find alternatives
- Use the rebooking tool to secure a new reservation
- Generate a new boarding pass using the document creation tool
This design demonstrates how MCP Tools enable AI agents to take concrete actions with external systems while maintaining user consent and transparency1.
Resources: Research Assistant Agent
A university research assistant agent could be designed to leverage MCP Resources for academic support:
Design approach:
- The agent connects to multiple resource repositories including the university library database, research papers, course materials, and private research wikis
- When a researcher asks “What are the latest findings on quantum computing’s impact on cryptography?”, the agent would:
- Access library database resources to retrieve recent papers
- Read through departmental research wikis for unpublished findings
- Scan course materials for foundational context
- Synthesise information across these resources to provide a comprehensive overview
This implementation shows how MCP Resources allow agents to access and interpret diverse information sources without requiring custom integration for each data repository.
Prompts: Healthcare Documentation Agent
A medical documentation agent could be designed to leverage MCP Prompts for standardised healthcare workflows:
Design approach:
- The agent utilises predefined prompt templates for common clinical documentation needs including patient assessments, treatment plans, and follow-up instructions
- When a doctor says “Document the follow-up plan for Mrs Johnson’s hypertension”, the agent would:
- Activate the standardised hypertension follow-up prompt template
- Follow the structured template to ensure all required elements are included (medication schedule, blood pressure monitoring, dietary recommendations)
- Populate the template with patient-specific details from medical records
- Generate properly formatted documentation that meets clinical standards
This example illustrates how MCP Prompts create consistency across interactions by providing reusable templates that standardise complex workflows, ensuring thoroughness and compliance with established protocols2
Enterprise Systems Integration
- GitHub Integration: MCP tools like “list_issues,” “create_issue,” and “add_comment” allow AI assistants to interact with GitHub repositories without requiring knowledge of the underlying API details.
- Cloud Management: Upsun.com’s command-line interface uses MCP to enable AI assistants to read logs from cloud-hosted websites, identify problems, and take corrective actions directly in the cloud hosting environment.
- Slack Integration: Pre-built MCP servers allow AI assistants like Claude to retrieve conversations from Slack channels, providing access to organisational knowledge stored in messaging platforms.
- Google Drive: MCP servers for Google Drive enable AI assistants to search and retrieve documents, making corporate knowledge bases accessible during conversations.
Development and Coding Tools
- Sourcegraph’s Cody: This tool uses MCP to pull in additional “context outside the code” from repositories or issues to better answer coding queries.
- SQLite Database Access: Reference MCP servers allow AI to run SQL queries on local SQLite databases, which coding assistants can use to fetch test data or configurations.
- Replit, Zed, and Codeium: These development platforms are integrating MCP to enhance their coding tools, allowing AI to better understand coding tasks and produce more functional code.
Data Collection and Analysis
- Apify Actors MCP Server: Allows AI agents to collect data from websites (such as Facebook posts and Google search results), summarise web trends, and execute automated workflows without user intervention.
- Database Connectors: MCP servers for Postgres databases enable AI assistants to query structured data directly.
Web Interaction
- Puppeteer MCP Server: Lets AI navigate and scrape websites, essentially giving it a web browser tool to interact with online content.
- Gmail Agent: A community-built MCP tool that can read and draft emails via a Gmail connector.
Personal Productivity
- Virtual Assistants: MCP enables personal AI agents that can, in a single workflow, read emails, add events to calendars, update to-do lists, and even control smart devices through standardised connections.
These examples demonstrate how MCP is creating a universal interface that allows AI tools to interact with content repositories, business platforms, and development environments through a standardised protocol rather than requiring custom integrations for each system.
Setting Up Your MCP Server
To set up an MCP Server that allows AI agents to access various IT systems, you’ll need to follow specific steps for connecting to databases, APIs, and other systems. Here’s a comprehensive guide:
Prerequisites
- Node.js: Ensure Node.js is installed on your system. You can check by running
node --versionin your terminal. - MCP Client/Host: You’ll need an MCP-compatible application like Claude Desktop, Cursor, or another AI tool that supports MCP.
Connecting to Different Systems
1. Databases
For PostgreSQL/Supabase:
-
Install the Postgres MCP server:
textnpx -y @modelcontextprotocol/server-postgres <connection-string> -
Replace
<connection-string>with your database connection string from Supabase or other Postgres provider.
For Neon Postgres:
- Use the Neon MCP server to connect to Neon databases through their API
- This allows natural language interaction with your databases for operations like creating tables, running queries, and exploring schemas.
2. APIs and Web Services
For REST APIs:
- You can create custom MCP servers that connect to REST endpoints
- Define tools that make HTTP requests to your API endpoints.
- For GraphQL APIs, use the mcp-graphql server which provides schema introspection and query execution capabilities.
For Web Scraping:
- Services like Firecrawl MCP or Apify Actors MCP Server allow AI agents to collect data from websites and execute automated workflows.
3. Local File Systems
-
Configure the Filesystem MCP Server to give your AI agent access to local files and directories:
text{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/path/to/directory1", "/path/to/directory2" ] } } } -
Replace the paths with directories you want to make accessible.
4. Smart Home Systems
- Home Assistant offers an MCP Server integration that allows AI agents to control smart home devices through the Assist API
- This enables natural language control of your exposed entities and devices.
Configuring Your MCP Client
For Claude Desktop
- Locate your
claude_desktop_config.jsonfile:- macOS:
~/Library/ApplicationSupport/Claude/claude_desktop_config.json - Windows:
%APPDATA%\\\\Claude\\\\claude_desktop_config.json
- macOS:
- Add your MCP server configurations to this file and restart Claude.
For Cursor IDE
- Go to Settings > Features > MCP
- Click ”+ Add New MCP Server”
- Select the transport type (stdio, SSE, etc.)
- Provide a name and either the command to run or the URL of the server.
Building Custom MCP Servers
If you need to connect to systems without pre-built MCP servers:
- Create a new TypeScript/JavaScript project
- Implement the MCP protocol with tools that connect to your specific systems
- Define tools with clear descriptions and input schemas
- Implement handlers that connect to your IT systems via their APIs.
Security Considerations
- MCP servers have access to the systems they connect to, so ensure proper authentication and authorisation
- Consider using environment variables for sensitive credentials
- Limit the scope of access to only what’s necessary for your AI agents to function
By following these steps, you can create an MCP server ecosystem that allows AI agents to securely interact with your IT infrastructure through a standardised protocol.
Integrating MCP Servers with APIs and External Services
There are several approaches to integrate MCP servers with APIs and external services, allowing AI agents to interact with external systems through a standardized protocol.
Using Pre-built MCP Servers
OpenAPI MCP Server
The OpenAPI MCP Server allows you to connect to any REST API that has an OpenAPI v3.1 specification. This server:
- Exposes OpenAPI endpoints as MCP resources for easy discovery
- Supports configuration through environment variables
- Can be configured within Claude Desktop by editing a JSON configuration file
MCP API Connect
This tool enables connections to any REST API by:
- Allowing users to provide API documentation and keys
- Supporting global installation for seamless use across systems
- Requiring simple setup with
npm i -g mcp-api-connect
Building Custom MCP Servers
For REST APIs
You can create custom MCP servers that connect to REST endpoints by:
- Defining tools that make HTTP requests to your API endpoints
- Using libraries like the TypeScript SDK to create customised servers
- Implementing proper error handling and authentication
Using Cloudflare Workers
Cloudflare offers the ability to set up MCP servers using Cloudflare Workers:
- Requires just a few lines of scripting
- Enables interaction with various Cloudflare services (Workers, D1 databases, KV namespaces)
- Allows users to manage resources with natural language queries
Implementation Approaches
Standard Input/Output (stdio)
For local integrations:
typescriptimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const server = new McpServer({ name: "example-server", version: "1.0.0" });
const transport = new StdioServerTransport();
await server.connect(transport);
Server-Sent Events (SSE)
For remote integrations:
- Uses HTTP POST requests for client-to-server communication
- Leverages Server-Sent Events for server-to-client streaming
- Suitable when the MCP server is hosted remotely
Real-World Examples
MCP servers have been implemented across multiple domains:
- GitHub: Repository management and file operations
- Slack: Channel management and messaging capabilities
- Stripe: Integration with payment processing via their Agent Toolkit
- Cloudflare: Deployment and management of resources
- Neon: Interaction with serverless Postgres databases
Best Practices
When building MCP servers for API integration:
- Use clear names and descriptions for tools
- Provide detailed schema definitions
- Implement proper error handling
- Keep tool operations focused
- Consider rate limiting and security
- Validate all inputs and implement access control
By following these approaches, you can effectively integrate MCP servers with APIs and external services, enabling AI agents to interact with your systems through a standardised protocol.