MCP Lens

Tools & Infrastructure 💻 TypeScript ⚖️ MIT 🟢 Actively maintained
8 stars

MCP Lens is a plugin for DeepSeek Harness that shrinks large MCP catalogs to a two-tool model surface (mcp_search and mcp_call), reducing context and cost. It solves the problem of sending every tool schema on every turn by revealing exact schemas only for a small ranked set when needed. It is for developers using DeepSeek Harness with dozens to thousands of MCP tools, multiple servers, or long-tail tools.

✨ Key features

  • Reduces MCP surface to two stable tools: mcp_search and mcp_call.
  • Lazy server connections: no MCP process or socket on activation.
  • Search returns exact inputSchema for a small ranked set.
  • allowTools and denyTools gate all tool visibility and calls.
  • Reuses tokenized index for frozen catalogs; invalidates on change.
  • Includes a GitHub Action for schema budget CI checks.

🎯 Use cases

  • Manage large MCP catalogs with hundreds or thousands of tools.
  • Reduce API input tokens and cost in DeepSeek Harness requests.
  • Keep standing context small by not advertising all tool schemas.
  • Connect multiple MCP servers while hiding risky tools by default.
  • Audit tool schema size in CI with the provided GitHub Action.

📦 Installation

🧰 Requirements: Requires DeepSeek Harness 0.1.0-rc.6, Node.js ^22.19.0 or >=24.0.0, and pnpm on PATH. No additional API key for the MCP docs server; Harness needs your model provider.

dsh plugin --profile web add dsh-mcp-lens@next

For reproducible install, pin the reviewed version:

dsh plugin --profile web add dsh-mcp-lens@0.1.0-rc.9

To install from the GitHub Release tarball after verifying SHA-256:

curl -fL --retry 3 -o dsh-mcp-lens-0.1.0-rc.9.tgz \
  https://github.com/labmimors/dsh-mcp-lens/releases/download/v0.1.0-rc.9/dsh-mcp-lens-0.1.0-rc.9.tgz
shasum -a 256 dsh-mcp-lens-0.1.0-rc.9.tgz
Compare the output with the SHA-256 shown for the .tgz on the rc.9 Release page.
dsh plugin --profile web add ./dsh-mcp-lens-0.1.0-rc.9.tgz

On Windows, download the asset and compare Get-FileHash -Algorithm SHA256 before adding.

🚀 Usage

After installing, edit $DSH_HOME/profiles/web/cordis.patch.yml (default ~/.dsh/profiles/web/cordis.patch.yml). If it contains only [], replace with the block below; if it has - id entries, append as another top-level list item:

- id: mcp-lens
  config:
    servers:
      - name: mcp-docs
        transport: streamable-http
        url: https://modelcontextprotocol.io/mcp
    cachePath: !!js dshHomePath('mcp-lens/catalog.json')
    allowTools:
      - mcp-docs/search_model_context_protocol
      - mcp-docs/query_docs_filesystem_model_context_protocol
    denyTools: ['mcp-docs/submit_feedback']

Then validate and start:

dsh --profile web --dump-config
dsh --profile web

Ask a normal question like: "Use the official MCP documentation server to explain when an MCP client should use Streamable HTTP."

⚠️ Good to know

MCP Lens is designed for large, multi-server, or long-tail catalogs; it adds a search step and more output tokens, so it is not beneficial for a handful of tools used on every request. The retrieval evaluation covers covered-call lexical retrieval only, not end-to-end task completion or general qual

❓ FAQ

How does MCP Lens reduce the number of tools the model sees?

Instead of exposing all tool schemas, it presents only two stable tools: mcp_search and mcp_call. When a tool is needed, mcp_search returns a small ranked set of exact schemas, and mcp_call invokes the specific server/tool.

What are the prerequisites for installing MCP Lens?

You need DeepSeek Harness 0.1.0-rc.6, Node.js ^22.19.0 or >=24.0.0, and pnpm on PATH. The dsh plugin command delegates installation to pnpm.

How do I allow specific tools?

In the cordis.patch.yml configuration, set the allowTools list with exact server/tool identities, supporting wildcards like 'knowledge/read_*'. An empty allowTools list allows nothing, and denyTools always wins.

Does MCP Lens work with authenticated MCP servers?

Yes, you can add headers like Authorization in the server config. Use cacheNamespace as a non-secret identity for tenant/scope; never put credentials in it. If a credentialed server omits cacheNamespace, the catalog is kept memory-only and rediscovered after restart.

📊 Repository

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.