MCP-Lens
Click on "Deploy 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-Lenssearch for a tool to list files"
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.
@m8t-jacob/mcp-lens
mcp-lens is an MCP (Model Context Protocol) proxy/router that sits in front of your fleet of downstream MCP servers and exposes only a handful of meta-tools to the host, instead of every downstream tool definition.
The problem
Power users of Claude Code / Claude Desktop / Cursor connect 10+ MCP servers. Each one dumps the full definition (name, description, JSON Schema) of every tool it has — often 100-200 tools total — straight into the model's context window, on every single turn. That's tokens (and money) spent before the model has even done anything.
Related MCP server: MCP Gateway
How mcp-lens fixes it
Instead of connecting the host directly to N servers, you connect it to one mcp-lens process, and mcp-lens connects to the N servers on your behalf:
Host (Claude) ── mcp-lens ──┬── github MCP server
├── slack MCP server
├── filesystem MCP server
└── ... (N more)The host only ever sees 4 small meta-tools:
Tool | What it does |
| Free-text search over every downstream tool's name/description. Returns the best matches with their full schema. |
| Full input schema + description for one specific |
| Proxies an actual |
| Lists connected downstream servers and their tool counts. |
When the model needs a capability, it calls search_tools to find the
right downstream tool, then call_tool to actually run it — the full tool
list is discovered on demand, never loaded up front.
Definition-size savings
Measured by scripts/benchmark.ts (npm run benchmark), against 100
fictitious downstream tools with realistic descriptions and JSON schemas,
spread across 8 servers:
Downstream tools | Downstream tool definitions | mcp-lens meta-tool definitions | Reduction |
100 | 79,792 bytes | 1,395 bytes | 98.3% |
Run it yourself: npm run benchmark (accepts an optional tool-count
argument, e.g. npm run benchmark -- 200).
Honest caveat: mcp-lens's own 4 meta-tool definitions have a small, fixed cost (~1.4 KB). For a single downstream server exposing only 1-2 trivial tools, that fixed cost can outweigh the savings — mcp-lens earns its keep once your fleet grows past roughly a handful of tools, and the benefit compounds from there (98%+ at 100 tools, as measured above). If you only ever connect one or two lightweight MCP servers, connecting them directly may be simpler.
Install for Claude Code / Claude Desktop
Create a fleet config (see
examples/mcp-lens.config.json):{ "servers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"] }, "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"] } } }The shape matches the
mcpServersobject you already have inclaude_desktop_config.json/.mcp.json— each entry is just{ command, args?, env? }.Point your MCP client at
mcp-lensinstead of at each server individually:{ "mcpServers": { "lens": { "command": "npx", "args": ["-y", "@m8t-jacob/mcp-lens", "/absolute/path/to/mcp-lens.config.json"], "env": { "MCP_LENS_CONFIG": "/absolute/path/to/mcp-lens.config.json" } } } }The config path can be passed either as the first CLI argument or via
MCP_LENS_CONFIG(the argument wins if both are set).Move your existing per-server entries out of the host's own MCP config and into the mcp-lens fleet config instead — the host now only launches
mcp-lens, which launches (and proxies to) the rest.
You can also run it directly to smoke-test it:
npx -y @m8t-jacob/mcp-lens ./mcp-lens.config.jsonIt logs a one-line summary of the definition-size savings to stderr on startup, then sits waiting for JSON-RPC requests on stdin — that's expected; it's meant to be driven by an MCP client, not used interactively.
Programmatic use
import { buildServer, ToolCatalog, ToolProxy, loadConfig } from '@m8t-jacob/mcp-lens';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
const config = loadConfig('./mcp-lens.config.json');
const proxy = new ToolProxy(config.servers);
const catalog = new ToolCatalog();
await catalog.build(proxy.serverNames(), (name) => proxy.getClient(name));
const server = buildServer({ getCatalog: () => catalog.list(), proxy });
await server.connect(new StdioServerTransport());searchTools (the ranking function behind search_tools) and ToolCatalog
are also exported directly, e.g. for building your own UI over the fleet
catalog. See examples/basic.ts.
Design notes
Built on the official
@modelcontextprotocol/sdk—McpServer+StdioServerTransporton the host-facing side,Client+StdioClientTransporton the downstream-facing side (mcp-lens is both an MCP server and an MCP client).Downstream connections are lazy and reused: a server is only spawned when its tools are first listed or called, and the same connection is reused afterwards. If a downstream call fails, that connection is dropped so the next call reconnects instead of repeatedly hitting a broken pipe.
search_tools's ranking (src/search.ts) is a small TF-like text scorer behind aScorerinterface, so it can be swapped for an embeddings-based scorer later without touching any calling code.One broken downstream server doesn't take down the fleet: catalog building skips (and logs) any server that fails to connect or list its tools, the rest still work.
Strict TypeScript, dual ESM + CJS builds with
.d.ts, zero real network calls in the test suite (an in-processInMemoryTransportend-to-end test and a real-subprocessStdioClientTransporttest cover the full proxy path instead).
🇵🇱 Po polsku
@m8t-jacob/mcp-lens to proxy/router MCP, który staje przed flotą
serwerów MCP i eksponuje do hosta (Claude Desktop, Claude Code, Cursor)
tylko garść meta-narzędzi (search_tools, describe_tool, call_tool,
list_servers) zamiast definicji wszystkich narzędzi każdego serwera.
Power-userzy podłączający 10+ serwerów MCP, z których każdy wrzuca do
kontekstu modelu definicje 100-200 narzędzi, zyskują dzięki temu
80-95%+ oszczędności tokenów definicji (zmierzone: 98.3% redukcji przy 100
narzędziach) — model wyszukuje potrzebne narzędzie przez search_tools, a
następnie wywołuje je przez call_tool, zamiast widzieć od razu całą listę.
Konfiguracja floty downstreamowych serwerów ma taki sam kształt jak
mcpServers w .mcp.json/claude_desktop_config.json.
Contributing
Contributions are welcome! See CONTRIBUTING.md for the
development workflow and GOOD_FIRST_ISSUES.md for
ideas if you're looking for a place to start. This project follows the
Contributor Covenant.
License
MIT © 2026 Jakub Jagiełło
This server cannot be deployed
Maintenance
Related MCP Connectors
Search, vet & assemble MCP servers from your agent: verified tools, risk labels, and trust scores.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Find, vet, and run MCP tools through a secure audited gateway with prompt-injection risk scoring
311The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceActs as a proxy for multiple MCP servers, reducing context window usage from 15,000+ tokens to ~500 tokens by dynamically loading servers on-demand and exposing only 3 tools instead of all tool definitions.5GPL 3.0
- AlicenseNot gradedqualityCmaintenanceAggregates multiple Model Context Protocol servers into a single gateway to provide unified search, description, and execution of tools. It reduces context limit issues by dynamically fetching specific tool schemas only when needed rather than loading all available tools at once.13 npm22MIT
- AlicenseNot gradedqualityDmaintenanceReduces LLM context window overhead by proxying multiple MCP servers through a few efficient dispatch tools instead of registering hundreds of individual tool schemas. It supports multi-account routing and tool discovery for both CLI-based and persistent MCP server configurations.MIT
- AlicenseNot gradedqualityAmaintenanceAggregates tools from multiple upstream MCP servers and exposes them through 4 meta-tools, enabling LLMs to discover and use hundreds of tools without loading all schemas upfront.2Apache 2.0