Overview

πŸš€ MCP Proxy Wrapper

Transform any MCP server into a powerful, extensible platform with enterprise-grade features

NPM VersionGitHub StarsLicenseTypeScript

npm install mcp-proxy-wrapper

✨ What is MCP Proxy Wrapper?

The MCP Proxy Wrapper is a TypeScript library that wraps existing Model Context Protocol (MCP) servers to add advanced functionality through a sophisticated plugin system, all without requiring any changes to your existing MCP server code.

Zero-Modification Enhancement: Add smart features like LLM summarization, chat memory, and custom processing to any MCP server without touching the original code.

🎯 Core Concept

The proxy wrapper intercepts tool calls between clients and your MCP server, allowing plugins to:

  • πŸ” Authenticate and authorize users before tool execution
  • πŸ’° Monitor and bill for tool usage in real-time
  • ⚑ Transform requests and responses for enhanced functionality
  • πŸ“Š Log and analyze usage patterns and performance
  • πŸš„ Cache responses for improved performance
  • πŸ›‘οΈ Rate limit to prevent abuse

πŸš€ Quick Navigation

⭐ Key Features

πŸ”Œ Plugin Architecture

Extensible hook system for beforeToolCall and afterToolCall with zero server modifications.

πŸ€– AI Enhancement Plugins

LLM Summarization and Chat Memory plugins included for intelligent tool enhancement.

πŸ” Authentication & Security

Flexible hook system for implementing access control, rate limiting, and user management.

πŸ“ˆ Analytics & Monitoring

Usage tracking, performance metrics, error reporting, and real-time monitoring capabilities.

🌐 Transport Agnostic

Works with STDIO, WebSocket, SSE, HTTP, and InMemory transport protocols.

🏒 Enterprise Ready

Robust error handling, comprehensive logging, and production-grade features.

πŸ”§ How the Proxy Wrapper Works with Tools

πŸ’‘

The proxy wrapper enhances your MCP server without breaking existing functionality - it's completely backward compatible!

  1. Tools registered BEFORE wrapping: Remain fully available and functional, but don't get enhanced with hooks/plugins
  2. Tools registered AFTER wrapping: Get full plugin functionality (summarization, memory, analytics, etc.)
  3. All underlying server functionality: Completely preserved (resources, prompts, metadata, transport)

The proxy wrapper intercepts the server.tool() method registration process, not the tools themselves. So when you call wrapWithProxy(server), it overrides how new tools are registered to add the hook functionality, but existing tools continue to work exactly as before.

πŸ“– This behavior is documented in detail in the Getting Started guide and How It Works section with examples showing the difference between enhanced and non-enhanced tools.

πŸ’» Quick Example

import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { wrapWithProxy, LLMSummarizationPlugin } from 'mcp-proxy-wrapper';
import { z } from 'zod';
 
// Create your MCP server
const server = new McpServer({ name: 'My AI Tools', version: '1.0.0' });
 
// Add AI enhancement plugin
const summarizationPlugin = new LLMSummarizationPlugin();
 
// Wrap with proxy functionality
const proxiedServer = await wrapWithProxy(server, {
  plugins: [summarizationPlugin]
});
 
// Register tools as usual - enhancement happens automatically
proxiedServer.tool('ai-analysis', {
  text: z.string()
}, async (args) => {
  return {
    content: [{ type: 'text', text: `Analysis result: ${args.text}` }]
  };
});

🎯 Ready to Transform Your MCP Server?


MCP Proxy Wrapper - Enhance any MCP server without changing a single line of code