New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@mentu/metamcp

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mentu/metamcp

A meta-MCP server that collapses N child MCP servers into 4 tools. Intent routing, lazy spawning, connection pooling, semantic search, and sandboxed code execution.

Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
93
-52.79%
Maintainers
1
Weekly downloads
 
Created
Source

MetaMCP

npm version Node.js License TypeScript CI

MetaMCP is a meta-MCP server that sits in front of N child MCP servers, collapsing hundreds of tools into 4 meta-tools (~1,000 schema tokens). Built to be composable, lazy, isolated, and fast.

How It Works

                        ┌─── playwright (52 tools)
                        │
LLM ──► MetaMCP ────────┼─── fetch (3 tools)
        (4 tools)       │
                        ├─── sqlite (6 tools)
                        │
                        └─── ... N more servers

Your LLM sees 4 tools. MetaMCP handles discovery, routing, connection lifecycle, and sandboxed execution across all child servers.

Documentation

Full documentation at metamcp.org.

Installation

npx @mentu/metamcp              # run directly (no install)
npm install -g @mentu/metamcp    # or install globally

Auto-configure your MCP client (Claude Desktop, Claude Code, Cursor, VS Code, Windsurf, and more):

npx @mentu/metamcp init

Note: MetaMCP optionally uses better-sqlite3 for semantic search (vector embeddings). This requires a C++ compiler for native compilation. If compilation fails, MetaMCP still works fully with keyword-only search. On macOS, run xcode-select --install if you see build errors. On Linux, install build-essential.

Quick Start

1. Create a .mcp.json in your project root:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    },
    "sqlite": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-sqlite", "/path/to/db"]
    }
  }
}

2. Run MetaMCP:

npx @mentu/metamcp --config .mcp.json

3. Connect your LLM. MetaMCP speaks MCP over stdio — point Claude Desktop, Claude Code, or any MCP client at it.

Tools

mcp_discover — Search & list

Search tool catalogs across all child servers. Without a query, returns server status and tool counts.

ParameterTypeRequiredDescription
querystringnoSearch query for tools
serverstringnoFilter to a specific server
{ "query": "screenshot" }

mcp_provision — Intent-based routing

Describe what you need and MetaMCP resolves the right server. Searches local catalogs first, then the npm registry for installable MCP servers.

ParameterTypeRequiredDescription
intentstringyesWhat capability you need
contextstringnoAdditional context for resolution
autoProvisionbooleannoAuto-provision if trusted (default: false)
{ "intent": "I need to crawl a website and extract links" }

mcp_call — Forward to child server

Forward a tool call to a specific child server. Retries once on crash for vital servers.

ParameterTypeRequiredDescription
serverstringyesTarget server name
toolstringyesTool name to call
argsobjectnoArguments to pass to the tool
{ "server": "playwright", "tool": "browser_navigate", "args": { "url": "https://example.com" } }

mcp_execute — Sandboxed code execution

Execute code in a V8 sandbox with access to all provisioned servers. Supports async/await, sleep(ms), and console.log. No access to process, require, fs, or the network.

ParameterTypeRequiredDescription
codestringyesCode to execute
{ "code": "const result = await servers.sqlite.call('query', { sql: 'SELECT count(*) FROM users' }); return result;" }

Configuration

MetaMCP reads .mcp.json — the same format used by Claude Desktop and Claude Code.

npx package:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    }
  }
}

Local binary:

{
  "mcpServers": {
    "my-server": {
      "command": "/usr/local/bin/my-mcp-server",
      "args": ["--port", "8080"]
    }
  }
}

With environment variables:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_TOKEN": "ghp_..."
      }
    }
  }
}

Remote server (SSE):

{
  "mcpServers": {
    "remote-tools": {
      "url": "https://mcp.example.com/sse",
      "transportType": "sse",
      "headers": {
        "Authorization": "Bearer your-token"
      }
    }
  }
}

Remote server (Streamable HTTP) with OAuth:

{
  "mcpServers": {
    "cloud-server": {
      "url": "https://mcp.example.com/api",
      "oauth": true
    }
  }
}

MetaMCP supports three transport types: stdio (local process, default), http (Streamable HTTP), and sse (Server-Sent Events). Servers with a url field use HTTP by default. Set transportType to sse for SSE servers. OAuth triggers a browser-based authorization flow on first connect, with tokens persisted at ~/.metamcp/oauth/.

CLI Options

FlagDefaultDescription
--config <path>.mcp.jsonPath to config file
--max-connections <n>20Connection pool max size
--idle-timeout <ms>300000Idle connection timeout (ms)
--failure-threshold <n>5Circuit breaker consecutive failures
--cooldown <ms>30000Circuit breaker cooldown (ms)
--helpShow help
--versionShow version

Architecture

MetaMCP manages child server lifecycles with:

  • Connection pool — bounded pool with LIFO idle list and configurable upper/lower bounds
  • Lazy spawning — child servers start on first use, not at boot
  • Circuit breaker — per-server failure tracking with automatic cooldown
  • LIFO eviction — when the pool is full, the oldest idle connection is evicted first
  • V8 sandbox — mcp_execute runs in a locked-down vm.Context with frozen prototypes, no eval, no require, no network access
  • Multi-transport — stdio for local servers, Streamable HTTP and SSE for remote servers, with OAuth support
  • Trust policy — registry packages are evaluated before auto-provisioning

Contributing

See CONTRIBUTING.md for development setup, commit conventions, and PR guidelines.

License

Apache-2.0

Keywords

mcp

FAQs

Package last updated on 02 Apr 2026

Related posts