npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mashh/mcp-agent-proxy

v0.0.7

Published

MCP proxy server that allows MCP clients to communicate with Mastra agent servers

Downloads

10

Readme

MCP Agent Proxy

npm version License: MIT CI

Connect any MCP client to any Mastra agent server - creating an "Internet of Agents" through simple, composable primitives.

Built for/with Mastra ❤️

Support for other Agent servers coming soon! Contribute? 😉

Quick Start

Add this to your MCP client's configuration:

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "npx",
      "args": ["@mashh/mcp-agent-proxy@latest"]
    }
  }
}

That's it! The proxy automatically connects to http://localhost:4111 and exposes all agents as MCP tools.

https://github.com/user-attachments/assets/e816c0cb-48e5-471b-8ff4-9107bd6e8bb6

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 | | ------------------ | ------------------------------------------------------- | | listAgents | Discover available agents across all servers | | describeAgent | Get detailed agent capabilities for intelligent routing | | callAgent | Execute any agent with smart conflict resolution | | connectServer | Dynamically add new Mastra servers at runtime | | disconnectServer | Remove dynamically connected servers |

The Network Effect

Mastra servers can be MCP clients themselves, creating recursive agent networks:

Your MCP Client → MCP Proxy → Mastra Server → Agents -> MCP Proxy -> Other Agent Servers → 🚀 Agents

One configuration line unlocks entire ecosystems of AI capabilities.

Common Configurations

Multiple Servers

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "npx",
      "args": ["@mashh/mcp-agent-proxy"],
      "env": {
        "MASTRA_SERVERS": "http://localhost:4111 http://localhost:4222"
      }
    }
  }
}

Cloud + Local

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "npx",
      "args": ["@mashh/mcp-agent-proxy"],
      "env": {
        "MASTRA_SERVERS": "https://prod.vercel.app http://localhost:4111"
      }
    }
  }
}

From Source (Development)

{
  "mcpServers": {
    "mcpAgentProxy": {
      "command": "node",
      "args": ["/path/to/mcp-agent-proxy/dist/mcp-server.js"],
      "env": {
        "MASTRA_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 to

Smart Conflict Resolution:

I need to use the weatherAgent from server1 specifically, not the default one

Dynamic Network Expansion:

Connect to the ML specialists at https://ml-specialists.vercel.app and then use their modelTrainer agent

Environment Variables

| Variable | Default | Description | | ----------------- | ----------------------- | --------------------------------- | | MASTRA_SERVERS | http://localhost:4111 | Space/comma-separated server URLs | | MCP_SERVER_PORT | 3001 | Proxy server port | | MCP_TRANSPORT | http | Transport method (stdio/http) |

Examples & Advanced Usage

Ready-to-use configurations in the examples/ directory:

For advanced configuration options, see CONFIGURATION.md.

Troubleshooting

NPX Issues:

npx clear-npx-cache
npx @mashh/mcp-agent-proxy@latest

Port Conflicts:

"env": { "MCP_SERVER_PORT": "3002" }

Connection Issues:

  • Ensure Mastra servers are running and accessible
  • Check firewall settings and server URLs

Debug Mode:

DEBUG=mastra:* npx @mashh/mcp-agent-proxy

Development

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Build for production
pnpm build

# Run tests
pnpm test

Contributing

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.