A Model Context Protocol (MCP) hub that seamlessly connects AI clients with intelligent agents, enabling powerful cross-platform communication across multiple AI ecosystems.
MCP Agent Server creates a bridge between MCP-compatible clients (like Claude Desktop, VS Code, Cursor, etc.) and specialized AI agents. It enables you to:
This project leverages the mcp-ai-agent framework to simplify agent creation and management.
Clone the repository:
git clone <repository-url>
cd mcp-agent-server
Install dependencies:
npm install
Build the project:
npm run build
Get the full path to the generated dist/index.js
file:
pwd
# Example output: /Users/username/Projects/mcp-agent-server
# Full path would be: /Users/username/Projects/mcp-agent-server/dist/index.js
You can create a personalized agents configuration file that overrides the default agents-config.ts
by creating a file named my-agents-config.ts
in the project root. The server automatically detects and uses this file if it exists. The file needs to export an array of agent configurations.
To create your custom configuration:
my-agents-config.ts
in the project rootimport { AIAgent, Servers } from "mcp-ai-agent";
import { anthropic } from "@ai-sdk/anthropic";
// Import other AI SDKs as needed
agents
array containing all your agent configurationsHere's an example of a custom agents configuration with specialized tools and Claude models:
// my-agents-config.ts
import { AIAgent, Servers } from "mcp-ai-agent";
import { anthropic } from "@ai-sdk/anthropic";
// Choose the Claude model you want to use
const model = anthropic("claude-3-5-haiku-20241022");
// const model = anthropic("claude-3-7-sonnet-20250219"); // Uncomment for a more powerful model
// Code Context Agent
const codeContextAgent = new AIAgent({
name: "Code Context Agent",
description: "Use this agent to analyze and understand code in your projects",
toolsConfigs: [
Servers.sequentialThinking,
{
mcpServers: {
codeContext: {
command: "node",
args: ["/path/to/code-context-mcp/dist/index.js"],
},
},
},
],
model,
});
// Web Search Agent
const webSearchAgent = new AIAgent({
name: "Web Search Agent",
description: "Use this agent to search the web",
systemPrompt: "Prefer to use brave search to search the web for information.",
toolsConfigs: [Servers.sequentialThinking, Servers.braveSearch],
model,
});
// Master Agent that can manage other agents
const masterAgent = new AIAgent({
name: "Master Agent",
description: "An agent that can manage other specialized agents",
model,
toolsConfigs: [
{ type: "agent", agent: codeContextAgent },
{ type: "agent", agent: webSearchAgent },
// Add more agents as needed
],
});
// Export the agents array
export const agents: AIAgent[] = [
codeContextAgent,
webSearchAgent,
masterAgent,
];
You can include as many specialized agents as needed, such as:
Important: After creating or updating your custom configuration, remember to:
- Run
npm run build
to rebuild the project- Restart your MCP client to apply changes
You can use agents-config.ts
as a reference for creating your custom configuration. The default configuration includes:
Important: After making changes to your agent configurations, remember to:
- Run
npm run build
to rebuild the project- Restart your Claude client to apply changes
- On Windows, you may need to completely close Claude using Task Manager (Ctrl+Alt+Del) as it can continue running in the background
// Creating a specialized agent
const sequentialThinkingAgent = new AIAgent({
name: "Sequential Thinker",
description:
"Use this agent to think sequentially and resolve complex problems",
toolsConfigs: [
{
mcpServers: {
sequentialThinking: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-sequential-thinking"],
},
},
},
],
model: openai("gpt-4o-mini"),
});
// Creating a Claude-powered agent
import { anthropic } from "@ai-sdk/anthropic";
const claudeAgent = new AIAgent({
name: "Claude Assistant",
description: "A powerful AI assistant using Claude's capabilities",
toolsConfigs: [
{
mcpServers: {
memory: {
command: "npx",
args: ["-y", "@modelcontextprotocol/server-memory"],
},
},
},
],
// Using Claude's latest Sonnet model
model: anthropic("claude-3-7-sonnet-20250219"),
});
// Creating a master agent that uses multiple specialized agents
const masterAgent = new AIAgent({
name: "Master Agent",
description: "An agent that can manage other agents",
model: openai("gpt-4o-mini"),
toolsConfigs: [
{
type: "agent",
agent: sequentialThinkingAgent,
},
{
type: "agent",
agent: memoryAgent,
},
{
type: "agent",
agent: braveSearchAgent,
},
],
});
Note: The mcp-ai-agent framework supports various AI models through the AI SDK. You can use models from providers such as OpenAI, Anthropic, Google Generative AI, Mistral, Groq, and many others. Check the AI SDK Providers documentation for the complete list of supported models and their capabilities.
Add the MCP Agent Server to your MCP client configuration:
Edit your claude_desktop_config.json
:
{
"mcpServers": {
"mcp-agent-server": {
"command": "node",
"args": ["/full/path/to/mcp-agent-server/dist/index.js"]
}
}
}
Important: After making changes to
claude_desktop_config.json
, remember to:
- Restart your Claude client to apply changes
- On Windows, you may need to completely close Claude using Task Manager (Ctrl+Alt+Del) as it can continue running in the background
Follow the specific client's instructions for adding MCP servers, using:
node
["/full/path/to/mcp-agent-server/dist/index.js"]
Once configured, your agents will appear as tools in your MCP client. For example, in Claude Desktop, you can use them by:
/
to view available toolsYou can create custom tools directly in your agent configuration:
const calculatorAgent = new AIAgent({
name: "Calculator Agent",
description: "A calculator agent",
toolsConfigs: [
{
type: "tool",
name: "multiply",
description: "A tool for multiplying two numbers",
parameters: z.object({
number1: z.number(),
number2: z.number(),
}),
execute: async (args) => {
return args.number1 * args.number2;
},
},
// Add more tools...
],
});
The mcp-ai-agent framework supports various MCP servers:
npm run build
MCP Agent Server comes with a command-line interface (CLI) for working with agents.
You can test individual agents directly from the command line without connecting to an MCP client, this is helpful for debuging purposes.
npm run test-agent -- --name="Agent Name" --prompt="Your test prompt" --context="Optional context"
For example, to test the Brave Search Agent:
npm run test-agent -- --name="Brave Search" --prompt="What is the capital of France?" --context="I need geographical information"
You can also run the command directly:
node dist/index.js test-agent --name="Sequential Thinker" --prompt="How would I approach solving a complex math problem?"
Or test the Master Agent which combines multiple specialized agents:
node dist/index.js test-agent --name="Master Agent" --prompt="Store this information: Claude is an AI assistant by Anthropic" --context="I need to test the memory capabilities"
The test command will:
This is useful for:
The test command will list all available agents if you provide an invalid agent name.
This project is licensed under the MIT License.
{
"mcpServers": {
"mcp-agent-server": {
"env": {},
"args": [
"/full/path/to/mcp-agent-server/dist/index.js"
],
"command": "node"
}
}
}
Seamless access to top MCP servers powering the future of AI integration.