MCP AI Agent Server
Bridges Cline to an AI agent system through the Model Context Protocol, enabling message sending, session management, and assistant switching for seamless interaction with AI agents.
README
MCP AI Agent Server
An MCP server that bridges Cline to an AI agent system, allowing for seamless interaction with AI agents through the Model Context Protocol.
Features
- 🚀 Send Messages: Send messages to AI agents within a session.
- 💡 Session Management: Clear sessions and start new ones.
- 🔧 Assistant Management: Get a list of available assistants and change the assistant for a session.
Quick Start
Install via npm (Recommended)
npm install -g @avi/mcp-ai-agent-server
Install via npx (No installation required)
npx @avi/mcp-ai-agent-server
Configuration
For Cline
Add to your Cline MCP settings file:
Location:
- macOS:
~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Windows:
%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json - Linux:
~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
Configuration:
{
"mcpServers": {
"ai-agent-mcp": {
"command": "npx",
"args": ["@avi/mcp-ai-agent-server"],
"env": {
"AI_AGENT_API_KEY": "your-api-key-here",
"AI_AGENT_BASE_URL": "http://localhost:3000"
}
}
}
}
Available Tools
send_message
Send a message in a session with optional attachments.
Parameters:
messageContent(required): The message content to send.attachments(optional): An array of file attachments.
Example:
"Can you use send_message to say 'hello'?"
get_session
Get or create a session.
Parameters:
- None
Example:
"Get the current session."
clear_session
Clear the current session and start a new one.
Parameters:
- None
Example:
"Please clear the session."
get_assistants
Get a list of available assistants.
Parameters:
- None
Example:
"List the available assistants."
change_assistant
Change the assistant for a session.
Parameters:
sessionId(required): The session ID to update.newAssistantId(required): The ID of the new assistant.
Example:
"Change the assistant for the current session to 'assistant-2'."
Environment Variables
| Variable | Description | Required | Default |
|---|---|---|---|
AI_AGENT_API_KEY |
API key for authentication | Yes | - |
AI_AGENT_BASE_URL |
Custom API endpoint for the AI agent system | No | http://localhost:3000 |
Troubleshooting
Operation Timed Out
If you encounter an "Operation timed out" error, it means the request to the AI agent service is taking longer than the server's default internal timeout. You can resolve this by increasing the timeout value in your Cline MCP settings:
{
"mcpServers": {
"ai-agent-mcp": {
"command": "npx",
"args": ["@avi/mcp-ai-agent-server"],
"timeout": 300000, // 5 minutes
"env": {
"AI_AGENT_API_KEY": "your-api-key-here",
"AI_AGENT_BASE_URL": "http://localhost:3000"
}
}
}
}
Development
Build from source
git clone https://github.com/avi/mcp-ai-agent-server.git
cd mcp-ai-agent-server
npm install
npm run build
Testing locally
# Using MCP Inspector
npx @modelcontextprotocol/inspector ./build/index.js
# Manual testing
AI_AGENT_API_KEY=test-key node ./build/index.js
License
MIT - See LICENSE for details.
Acknowledgments
Built with the Model Context Protocol SDK
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.