MCPI (Model Context Protocol Integration) is an implementation of the Model Context Protocol (MCP) for AI-web connectivity. It enables AI agents to discover, verify, and transact with web services through a standardized protocol, now featuring a flexible plugin architecture and Hello Protocol extension.
Official Website https://mcpintegrate.com
Official Repository: https://github.com/McSpidey/mcpi
MCPI extends the Model Context Protocol to create a bridge between AI agents and web services. This implementation provides:
- WebSocket-based MCP protocol communication
- RESTful discovery endpoint
- DNS-based service discovery
- Plugin architecture for modular capabilities
- Generic operation handlers (SEARCH, GET, LIST)
- Referral relationships between services
- Chrome extension for automatic MCPI detection and interaction
- Hello Protocol for efficient AI-website introduction
The Hello Protocol is a key extension that enables AI agents to efficiently understand websites without having to process entire sites:
- Efficient Introduction: Server-side AI introduces itself with key information about the website
- Contextualized Responses: Websites can customize their introduction based on the visitor's context
- Capability Advertising: Immediately informs AI agents about available tools and capabilities
- SEO for AI: Enables websites to optimize for AI agent discovery with customizable introduction content
With Hello Protocol, AI agents can quickly learn about:
- Who the website represents
- What products or services they offer
- Key capabilities available through the API
- Primary topics and expertise areas
See the Hello Protocol Documentation for implementation details.
The MCPI system uses a plugin architecture that allows for modular and extensible capabilities:
- Plugins: Each capability is implemented as a self-contained plugin
- Plugin Registry: Central management of all available plugins
- Dynamic Operation: Plugins can be loaded and configured at runtime
- Extensibility: New capabilities can be added without modifying core code
MCPI comes with several built-in plugins:
- Website Plugin: Provides e-commerce capabilities (products, customers, orders, reviews)
- Weather Plugin: Demonstrates dynamic data generation with simulated weather forecasts
You can easily extend MCPI by creating your own plugins. Each plugin implements the McpPlugin trait, which defines methods for:
- Getting metadata (name, description, category)
- Listing supported operations
- Defining input schemas
- Executing operations
- Providing resources
- Rust and Cargo (2024 edition or newer)
- Internet connection for dependencies
- Dig command-line tool (for DNS discovery)
- Google Chrome (for the Chrome extension)
-
Clone the repository:
git clone https://github.com/McSpidey/mcpi.git cd mcpi
-
Create the
data
directory in the workspace root:mkdir -p data
-
Set up the required data files as described in the "Data Files" section below.
Build the entire workspace:
cargo build --workspace
Or build individual components:
cargo build -p mcpi-server
cargo build -p mcpi-client
cargo run -p mcpi-server
The server will start at http://localhost:3001
with the following endpoints:
- WebSocket endpoint:
ws://localhost:3001/mcpi
- REST discovery endpoint:
http://localhost:3001/mcpi/discover
The client has several options for connecting to MCPI servers:
cargo run -p mcpi-client
cargo run -p mcpi-client -- --domain example.com
cargo run -p mcpi-client -- --url ws://example.com/mcpi
cargo run -p mcpi-client -- --plugin weather_forecast
MCPI includes a Chrome extension that automatically detects websites with MCPI support and provides a user-friendly interface for interacting with MCPI services.
- Automatic Detection: Automatically detects websites with MCPI support via DNS TXT records
- Visual Indicators: Shows green icon when MCPI is available, gray when not
- Zero-Click Connection: Automatically connects to MCPI services when the popup is opened
- Quick Actions: Pre-configured example queries for each tool
- Tool Explorer: Browse and use all available tools, resources, and capabilities
-
Open Chrome Extensions Page:
- Open Chrome and type
chrome://extensions
in the address bar - Or use the menu (three dots) > More tools > Extensions
- Open Chrome and type
-
Enable Developer Mode:
- Toggle on "Developer mode" in the top right corner of the Extensions page
-
Load the Extension:
- Click "Load unpacked"
- Navigate to the
chrome-extension
folder in the repository - Select the folder
-
Test the Extension:
- Run the MCPI server locally (
cargo run -p mcpi-server
) - Visit
localhost:3001
in Chrome - The extension icon should turn green, indicating MCPI support
- Click the icon to open the interface and interact with the service
- Run the MCPI server locally (
-
Finding MCPI-Enabled Sites:
- The extension icon turns green when you visit a site with MCPI support
- A badge with "MCP" appears on the icon
-
Interacting with MCPI Services:
- Click the extension icon to open the popup interface
- Browse available capabilities, tools, and resources in the tabs
- Use quick action buttons for common operations
- Click a tool name to open its full interface for custom queries
The server requires a specific set of JSON files in the data
directory to operate. These files define the server's configuration, capabilities, and data.
Main configuration file defining provider info, capabilities, and referrals:
{
"provider": {
"name": "Example Store",
"domain": "example.com",
"description": "Online retailer of eco-friendly products",
"branding": {
"colors": {
"primary": "#3498db",
"secondary": "#2ecc71"
},
"logo": {
"vector": "https://example.com/logo.svg"
},
"typography": {
"primary": "Helvetica Neue"
},
"tone": "professional"
}
},
"referrals": [
{
"name": "Eco Shipping",
"domain": "ecoshipping.com",
"relationship": "trusted"
}
],
"capabilities": {
"product_search": {
"name": "product_search",
"description": "Search for products in catalog",
"category": "inventory",
"operations": ["SEARCH", "GET", "LIST"],
"data_file": "products.json"
},
"customer_lookup": {
"name": "customer_lookup",
"description": "Look up customer information",
"category": "customers",
"operations": ["GET", "LIST"],
"data_file": "customers.json"
}
}
}
Each capability references a data file that contains its data. These files should be placed in the data/mock
directory.
Configuration for the Hello Protocol extension that provides AI agent introductions:
{
"default": {
"introduction": "Hello! I'm the AI assistant for Example Store, an online retailer of eco-friendly products. How can I assist you today?",
"metadata": {
"primary_focus": ["sustainability", "eco-friendly", "zero-waste"],
"key_offerings": ["bamboo products", "recycled goods", "sustainable alternatives"],
"unique_selling_points": ["carbon-neutral shipping", "plastic-free packaging"]
}
},
"contexts": {
"shopping": {
"introduction": "Welcome to Example Store! We offer a wide range of eco-friendly products with free shipping on orders over $50.",
"highlight_capabilities": ["product_search", "order_history"]
}
}
}
MCPI supports DNS-based discovery that allows clients to find MCPI servers using DNS TXT records:
- Create a TXT record for your domain:
- NAME:
_mcp
- TYPE:
TXT
- CONTENT:
v=mcp1 url=https://api.example.com/mcpi/discover
- NAME:
- Client queries DNS for
_mcp.example.com
TXT record - Client extracts the discovery URL (
url=...
) - Client makes HTTP request to this discovery URL
- Server responds with full MCPI capabilities
- Client connects to WebSocket endpoint for MCP protocol
Test your DNS TXT record using the dig
command:
dig +short TXT _mcp.example.com
This implementation follows the Model Context Protocol (MCP) specification:
initialize
: Initialize the connectionresources/list
: List available resourcesresources/read
: Read a specific resourcetools/list
: List available toolstools/call
: Execute a capabilityping
: Check connection health
To create a new plugin:
- Create a new file in
mcpi-server/src/plugins/
(e.g.,my_plugin.rs
) - Implement the McpPlugin trait
- Register your plugin in the server's main function
While plugins can define custom operations, these standard operations are recommended:
- SEARCH: Find items matching criteria
- GET: Retrieve a specific item by ID
- LIST: List all available items
- CREATE: Create a new item (for writable plugins)
- UPDATE: Update an existing item (for writable plugins)
- DELETE: Remove an item (for writable plugins)
- HELLO: Introduce the website/service to an AI agent (new)
The server implements a plugin-based capability execution engine that:
- Loads the plugin registry
- Registers built-in and configured plugins
- Routes MCP protocol methods to appropriate plugins
- Handles WebSocket connections and JSON-RPC requests
- Provides plugin discovery and introspection
The client implements:
- DNS-based discovery
- HTTP-based capability discovery
- WebSocket-based MCP protocol communication
- Plugin-specific testing through command-line interface
The extension implements:
- Automatic MCPI detection via DNS TXT records
- Visual status indicators via icon color changes
- Automatic connection to discovered MCPI services
- User-friendly interface for exploring and using MCPI capabilities
- Pre-configured quick actions for common operations
This implementation can be extended in several ways:
- New Plugins: Add new capabilities by creating new plugins
- Authentication: Add JWT or OAuth authentication
- Database Integration: Replace file-based storage with database access
- Caching: Add caching for improved performance
- Economic Framework: Implement USDC-based reverse fees described in MCPI spec
- Enhanced Chrome Extension: Add additional features to the extension
- Missing Data Files: Ensure all data files referenced in
config.json
exist in thedata/mock
directory - JSON Formatting: Validate JSON files using a tool like
jq
- Permission Issues: Ensure the server has read access to the data files
- DNS Discovery: Verify TXT records with
dig +short TXT _mcp.example.com
- Connection Errors: Check network connectivity and server status
- WebSocket Issues: Verify that the server's WebSocket endpoint is accessible
- Extension Not Detecting MCPI: Check if the TXT record is correctly set up
- Connection Failures: Verify the WebSocket endpoint is accessible
- No Quick Actions: Ensure the tool names match those expected by the extension
We welcome contributions to the MCPI project! To contribute:
- Fork the repository on GitHub
- Create a feature branch
- Implement your changes
- Submit a pull request
Please ensure your code follows the project's style and includes appropriate tests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Based on the Model Context Protocol specification
- Inspired by the need for standardized AI-web connectivity