mcp-agent-proxy
Allows connecting to LangGraph agent servers, enabling discovery and execution of LangGraph agents.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-agent-proxylist all available agents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Agent Proxy
Connect any MCP client to any agent server - creating an "Internet of Agents" through simple, composable primitives.
Supports Mastra β€οΈ and LangGraph π¦πΈοΈ servers! π
Quick Start
Add this to your MCP client's configuration:
{
"mcpServers": {
"mcpAgentProxy": {
"command": "npx",
"args": ["mcp-agent-proxy@latest"]
}
}
}That's it! The proxy lets your MCP client connect to different agent servers and exposes agent interactions as MCP tools. It automatically detects agent server types and adapts accordingly.
https://github.com/user-attachments/assets/9eaf1d36-298f-430f-b9e8-37e921cce2d1
Related MCP server: AutoGen MCP Server
What This Does
Instead of building complex protocols, we provide 5 simple tools that let agents discover, connect, and orchestrate across unlimited networks:
Tool | Purpose |
| Discover available agents across all servers |
| Get detailed agent capabilities for intelligent routing |
| Execute any agent with smart conflict resolution |
| Dynamically add new agent servers at runtime |
| Remove dynamically connected servers |
Supported Server Types
Mastra: Support for local and remote Mastra servers
LangGraph: Support for local and remote LangGraph instances
Extensible: Plugin architecture makes it easy to add support for other agent frameworks
The Network Effect
Agent servers can be MCP clients themselves, creating recursive agent networks:
Your MCP Client β MCP Proxy β Agent Server (Mastra/LangGraph) β Agents -> MCP Proxy -> Other Agent Servers β π AgentsOne configuration line unlocks entire ecosystems of AI capabilities.
MCP Compliance & Features
β Fully MCP 2025-03-26 Compliant
Complete implementation of the latest Model Context Protocol specification
π Multi-Transport Support
Stdio Transport: Standard MCP client integration (
npx mcp-agent-proxy)Streamable HTTP: Modern HTTP-based transport with session management
Legacy SSE: Backward compatibility with existing SSE implementations
Automatic Detection: Seamlessly switches between transports based on client capabilities
Common Configurations
Multiple Servers (Mixed Types)
{
"mcpServers": {
"mcpAgentProxy": {
"command": "npx",
"args": ["mcp-agent-proxy"],
"env": {
"AGENT_SERVERS": "http://localhost:4111 http://localhost:2024"
}
}
}
}Cloud + Local (Mixed Mastra and LangGraph)
{
"mcpServers": {
"mcpAgentProxy": {
"command": "npx",
"args": ["mcp-agent-proxy"],
"env": {
"AGENT_SERVERS": "https://my-mastra.vercel.app http://localhost:2024"
}
}
}
}From Source (Development)
{
"mcpServers": {
"mcpAgentProxy": {
"command": "node",
"args": ["/path/to/mcp-agent-proxy/dist/mcp-server.js"],
"env": {
"AGENT_SERVERS": "http://localhost:4111"
}
}
}
}Usage Examples
Basic Agent Call:
Can you call the weatherAgent to get the current weather in New York City?Network Exploration
Explore the agents you're connected toSmart Conflict Resolution:
I need to use the weatherAgent from server1 specifically, not the default oneDynamic Network Expansion:
Connect to the ML specialists at https://ml-specialists.vercel.app and then use their modelTrainer agentEnvironment Variables
Variable | Default | Description |
| (none) | Space/comma-separated server URLs (supports Mastra and LangGraph) |
|
| Proxy server port |
|
| Transport method (stdio/http) |
Examples & Advanced Usage
Ready-to-use configurations in the examples/ directory:
mcp.json- Zero setupmulti-server-config.json- Multiple local serversvercel-config.json- Cloud deployment
For advanced configuration options, see CONFIGURATION.md.
Troubleshooting
NPX Issues:
npx clear-npx-cache
npx mcp-agent-proxy@latestPort Conflicts:
"env": { "MCP_SERVER_PORT": "3002" }Connection Issues:
Ensure agent servers are running and accessible
Check firewall settings and server URLs
For LangGraph: Default port is usually 2024 (
langgraph dev)For Mastra: Default port is usually 4111
Debug Mode:
DEBUG=mastra:* npx mcp-agent-proxyDevelopment & Testing
Validation Workflows
We've implemented comprehensive validation workflows to ensure code quality and MCP protocol compliance:
Quick Commands
# Quick validation (build + test + lint + format)
pnpm validate:quick
# Full validation (includes integration tests + health checks)
pnpm validate:full
# CI validation (includes coverage + dead code analysis)
pnpm validate:ciIndividual Commands
# Build and test
pnpm build
pnpm test
pnpm test:integration
# Code quality
pnpm lint
pnpm format
pnpm format:checkMCP Protocol Testing
# Test MCP protocol compliance
pnpm mcp:test
# Test security features
pnpm security:test
# Manual server testing
pnpm start # Start server
pnpm check # Check running server (requires jq)Test Coverage
355 total tests covering all components
Unit tests for all tools, plugins, and configuration
Integration tests for MCP protocol compliance
Security tests for origin validation and session management
Health checks for server monitoring
Available Scripts
Use pnpm run to see all available scripts, or use these common ones:
pnpm dev # Build and start development server
pnpm test # Run all tests
pnpm test:watch # Run tests in watch mode
pnpm build # Build for production
pnpm lint # Run ESLint
pnpm format # Format code with PrettierContributing
We welcome contributions! Please see our Contributing Guide for details.
License
MIT License - see LICENSE file for details.
π Configuration Guide β’ π Examples β’ π Issues β’ π¬ Discussions
Building the Internet of Agents, one connection at a time.
Available Tools
5 toolscallAgentA
Proxies requests to a target agent using appropriate client libraries. Supports generate and stream interactions. Use server:agentId format for multi-server environments with agent name conflicts.
| Name | Required | Description | Default |
|---|---|---|---|
| targetAgentId | Yes | ||
| interactionType | Yes | ||
| messages | Yes | ||
| serverUrl | No | ||
| threadId | No | ||
| resourceId | No | ||
| agentOptions | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations, so description carries full burden. Mentions proxying and two interaction types, but does not disclose side effects, authentication needs, rate limits, or failure modes. Minimal transparency beyond basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, no redundancy. Front-loaded with core purpose, then tucks in interaction modes and a naming tip. Every sentence earns its place; no fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 7 parameters, nested objects, no output schema, and no annotations, the description is too brief. Missing parameter details, return value description, prerequisites, and error conditions. Incomplete for the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%; description must compensate. Only hints at parameter usage via 'server:agentId format' (likely for targetAgentId). No explanation of messages structure, interactionType differences, serverUrl, etc. Leaves most parameters unexplained.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb and resource: 'proxies requests to a target agent'. Distinguishes from sibling tools (connect, describe, disconnect, list) by focusing on interaction. Adds specificity with 'generate and stream interactions' and naming convention for multi-server environments.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implied usage: call an agent when you need to send messages. Sibling tool names make alternatives obvious. Provides a practical guideline for multi-server naming. Lacks explicit when/not or exclusions, but context is adequate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
connectServerC
Connects to a new agent server (Mastra, LangGraph, etc.) and adds it to the proxy's server list.
| Name | Required | Description | Default |
|---|---|---|---|
| serverUrl | Yes | ||
| serverName | No | ||
| validateConnection | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, description is the sole source of behavioral info. It lacks details on side effects, permission requirements, connection validation steps, or behavior if server already exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, 17 words, achieves conciseness but at the expense of critical details. It is not overly verbose but fails to earn its place by providing necessary information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lacks output description, no return value info. With 3 parameters and 0% schema coverage, the description leaves significant gaps about functionality and results.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, yet description adds no explanation for the three parameters (serverUrl, serverName, validateConnection). No insight into their purpose or usage beyond schema types.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the tool connects to a new agent server and adds it to the proxy's server list. Specific verb 'connects' and resource 'agent server' distinguish it from siblings like disconnectServer and callAgent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives. Does not describe prerequisites, when to avoid, or compare with other agents management tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
describeAgentA
Gets detailed information about a specific agent, including its instructions/description.
| Name | Required | Description | Default |
|---|---|---|---|
| agentId | Yes | ||
| serverUrl | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It states it gets information (read-only implied) but doesn't explicitly confirm lack of side effects or mention any special requirements. Acceptable but could be more explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single 13-word sentence, no redundancy, and front-loaded with the key action and resource.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
No output schema exists, yet description does not clarify the structure of returned data beyond 'instructions/description'. For a 2-param tool, it is minimally adequate but could be more complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, and the description only mentions 'specific agent', loosely mapping to agentId. The serverUrl parameter is not explained at all, leaving its role unclear.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states it gets detailed information about a specific agent, including instructions/description. This clearly distinguishes it from siblings like listAgents and callAgent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use when needing agent details, but provides no explicit guidance on when to use versus siblings or any prerequisites. It could mention that listAgents is for overview and this is for in-depth info.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
disconnectServerA
Disconnects from a dynamically connected agent server and removes it from the proxy's server list.
| Name | Required | Description | Default |
|---|---|---|---|
| serverName | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses a destructive behavior (disconnect and remove), but does not mention side effects, reversibility, or error conditions. Basic behavioral context is present.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with essential information, no redundant words. Efficient and precise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has only one parameter and no output schema, the description covers the basic action adequately. However, it could mention error handling or preconditions for completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description adds minimal value by tying the 'serverName' parameter to the action, but does not specify format or provide examples beyond the property name.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (disconnects) and the resource (dynamically connected agent server) with the outcome (removes from proxy's server list). It is specific and distinguishes from sibling tools like connectServer.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for disconnecting a dynamically connected server, but lacks explicit guidance on when to use or not use, and no alternatives are mentioned. Sibling tools like connectServer provide contrast, but no direct exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
listAgentsA
Lists available agents on all configured agent servers. Supports both single and multi-server setups with automatic conflict detection.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes scope and conflict detection, but no mention of read-only nature, performance, or side effects; no annotations present.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, front-loaded with the core purpose, no redundant words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lacks details on return format or structure; has no output schema to compensate, but appropriate for a simple list tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters in schema, so description adds no additional parameter meaning; baseline score for 100% schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Lists available agents on all configured agent servers' with a specific verb and resource, and distinguishes from siblings like callAgent, describeAgent, etc.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides context (single/multi-server, conflict detection) and implies usage for agent discovery, but no explicit when-to-use or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
5 tool updates
v0.0.14- First observed
callAgent - First observed
connectServer - First observed
describeAgent - First observed
disconnectServer - First observed
listAgents
TDQS
Each tool has a distinct purpose: callAgent for proxying, connectServer/disconnectServer for server management, describeAgent for agent details, listAgents for listing. No overlap.
All tool names follow a consistent camelCase verb_noun pattern (callAgent, connectServer, etc.), making them predictable.
5 tools is well-suited for an agent proxy server, covering essential operations without excess or deficiency.
Covers core proxy functionality (connect/disconnect servers, list/describe agents, call agent). Minor gaps like missing server status or update operations, but not critical.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server connecting AI agents to non-custodial staking data across 130+ networks.
MCP server connecting AI agents to 100+ apps (Gmail, Slack, Notion, GitHub) via one-click OAuth.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA proxy server that unifies multiple MCP servers, enabling seamless tool, prompt, and resource management via the MetaMCP App.39155Apache 2.0
- AlicenseBqualityNot gradedmaintenanceAn MCP server that provides integration with Microsoft's AutoGen framework, enabling multi-agent conversations through a standardized interface.415-
- FlicenseAqualityDmaintenanceAn MCP server that enables LLMs to interact with Agent-to-Agent (A2A) protocol compatible agents, allowing for sending messages, tracking tasks, and receiving streaming responses.528-
- -licenseNot gradedqualityNot gradedmaintenanceA sophisticated MCP server providing advanced memory capabilities with RAG, hallucination detection, and enterprise-grade AI infrastructure for intelligent agent ecosystems.-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mashh-lab/mcp-agent-proxy'
If you have feedback or need assistance with the MCP directory API, please join our Discord server