MCP Proxy

The Plugged.in MCP Proxy is a lightweight, high-performance server that aggregates multiple Model Context Protocol (MCP) servers into a single unified interface.

What is MCP Proxy?

MCP Proxy acts as a gateway between AI assistants and multiple MCP servers, simplifying integration and management.
The proxy server:
  • Aggregates multiple MCP servers into one endpoint
  • Manages authentication and connection pooling
  • Transforms different transport types (STDIO, SSE, Streamable HTTP)
  • Provides unified tool discovery and invocation
  • Handles error recovery and retry logic

Architecture

Client Side

  • AI Assistants (Claude, GPT, etc.)
  • MCP Clients
  • API Consumers
  • Web Applications

Proxy Layer

  • Connection Management
  • Request Routing
  • Response Aggregation
  • Error Handling

MCP Servers

  • STDIO Servers
  • Streamable HTTP Servers
  • SSE Servers (deprecated)
  • Custom Implementations

Features

  • Tool Discovery
  • Resource Access
  • Prompt Templates
  • OAuth Support

Key Features

1. Multi-Transport Support

Supports all MCP transport types:
// STDIO Transport
{
  transport: {
    type: "stdio",
    command: "node",
    args: ["server.js"]
  }
}

// Streamable HTTP Transport
{
  transport: {
    type: "streamable",
    baseUrl: "https://api.example.com/mcp"
  }
}

// SSE Transport (deprecated)
{
  transport: {
    type: "sse",
    url: "https://api.example.com/sse"
  }
}

2. Unified Tool Interface

Access tools from multiple servers through one endpoint:
// Discover all available tools
const tools = await proxy.listTools();
// Returns tools from all connected servers

// Invoke a tool
const result = await proxy.invokeTool({
  name: "search_documents",
  parameters: { query: "MCP integration" }
});

3. Intelligent Routing

Automatically routes requests to the appropriate server:

4. Connection Management

  • Connection Pooling: Reuse connections for performance
  • Health Checks: Automatic server health monitoring
  • Retry Logic: Automatic retry with exponential backoff
  • Circuit Breaker: Prevent cascading failures

5. Authentication

Multiple authentication methods:
{
  auth: {
    type: "apiKey",
    key: process.env.PLUGGEDIN_API_KEY
  }
}

Use Cases

1. AI Assistant Integration

Connect multiple specialized MCP servers to your AI assistant:
// Configure proxy with multiple servers
const proxy = new MCPProxy({
  servers: [
    { name: "github", url: "mcp://github.com/servers/github" },
    { name: "slack", url: "mcp://slack.com/servers/slack" },
    { name: "database", url: "mcp://internal/database" }
  ]
});

// AI assistant can now access all tools
const response = await assistant.query(
  "Search GitHub issues and post summary to Slack"
);

2. Enterprise Integration

Aggregate internal and external MCP servers:
// Internal servers behind firewall
const internalServers = [
  { name: "crm", url: "mcp://internal.company.com/crm" },
  { name: "erp", url: "mcp://internal.company.com/erp" }
];

// External SaaS integrations
const externalServers = [
  { name: "salesforce", url: "mcp://salesforce.com/api" },
  { name: "hubspot", url: "mcp://hubspot.com/api" }
];

// Unified access through proxy
const proxy = new MCPProxy({
  servers: [...internalServers, ...externalServers]
});

3. Development Workflow

Simplify development with local and remote servers:
// Local development server
const localServer = {
  name: "dev",
  transport: {
    type: "stdio",
    command: "npm",
    args: ["run", "mcp:dev"]
  }
};

// Production servers
const prodServers = [
  { name: "api", url: "https://api.production.com/mcp" },
  { name: "data", url: "https://data.production.com/mcp" }
];

// Switch between environments easily
const proxy = new MCPProxy({
  servers: isDev ? [localServer] : prodServers
});

Performance

Optimization Strategies

Security

Built-in Security Features

Always use authentication and encryption in production environments.
  1. Authentication: Required for all production deployments
  2. Rate Limiting: Prevent abuse and DoS attacks
  3. Input Validation: Sanitize all inputs before forwarding
  4. Audit Logging: Track all tool invocations
  5. Encryption: TLS/SSL for all network communication

Security Configuration

{
  security: {
    authentication: {
      required: true,
      type: "apiKey"
    },
    rateLimiting: {
      enabled: true,
      requests: 100,
      window: 60000 // 1 minute
    },
    cors: {
      enabled: true,
      origins: ["https://trusted.domain.com"]
    },
    audit: {
      enabled: true,
      level: "info"
    }
  }
}

Monitoring

Health Checks

The proxy provides health endpoints:
# Overall health
GET /health
{
  "status": "healthy",
  "servers": {
    "connected": 5,
    "healthy": 5
  }
}

# Individual server health
GET /health/servers
{
  "servers": [
    { "name": "github", "status": "healthy", "latency": 45 },
    { "name": "slack", "status": "healthy", "latency": 120 }
  ]
}

Metrics

Track proxy performance:
// Prometheus metrics endpoint
GET /metrics

# HELP mcp_proxy_requests_total Total requests
# TYPE mcp_proxy_requests_total counter
mcp_proxy_requests_total{method="listTools"} 1234

# HELP mcp_proxy_latency_seconds Request latency
# TYPE mcp_proxy_latency_seconds histogram
mcp_proxy_latency_seconds_bucket{le="0.1"} 900

Comparison

MCP Proxy vs Direct Connection

FeatureMCP ProxyDirect Connection
Multiple Servers✅ Unified access❌ Separate connections
Authentication✅ Centralized❌ Per-server config
Connection Management✅ Pooling & reuse❌ Manual handling
Error Recovery✅ Automatic retry❌ Manual implementation
Tool Discovery✅ Aggregated❌ Per-server query
Performance✅ Optimized⚠️ Depends on implementation
Monitoring✅ Built-in❌ Custom implementation

Getting Started

1

Install

Install the MCP Proxy package Installation Guide
2

Configure

Set up your servers and authentication Configuration Guide
3

Connect

Connect your AI clients to the proxy Integration Guide
4

Monitor

Set up monitoring and alerts Monitoring Guide

Next Steps