mcp-tool-search
A standalone MCP gateway/proxy server that lets any MCP-compatible client search and call tools across multiple downstream MCP servers through a single mcp proxy tool.
README
mcp-tool-search
A standalone MCP (Model Context Protocol) gateway/proxy server that lets any MCP-compatible client (Cursor, Claude Code, Codex, VSCode, Windsurf, Claude Desktop, Pi) search and call tools across multiple downstream MCP servers through a single mcp proxy tool.
Features
- Single
mcpproxy tool (~200 tokens) for on-demand tool search/describe/call - Connects to multiple downstream MCP servers (stdio, HTTP, SSE, StreamableHTTP)
- Direct tool mode: expose individual MCP tools as native tools
- Metadata caching with content-based invalidation
- OAuth authentication support (authorization_code + client_credentials)
- npx resolution (skip ~143MB npm parent process)
- Output guarding (50KiB / 2000 line truncation)
- Config compatible with standard MCP
mcpServersformat - stdio transport only (all clients supported)
- Builds with tsup (esbuild) — keeps
.tsimport extensions in source, compiles to single-file.jsbundle
Quick Start
Installation
npm install -g mcp-tool-search
Or build from source:
git clone https://github.com/ericnunes30/mcp-gateway-proxy.git
cd mcp-gateway-proxy
npm install
npm run build
Configuration
Create a config file at ~/.config/mcp-tool-search/config.json:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
},
"github": {
"url": "https://api.github.com/mcp",
"headers": { "Authorization": "Bearer YOUR_TOKEN" }
}
}
CLI Usage
# Using --mcp-config (preferred)
node dist/cli.js --mcp-config ~/.config/mcp-tool-search/config.json
# --config also works as an alias
node dist/cli.js --config ~/.config/mcp-tool-search/config.json
Client Configuration
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"mcp-tool-search": {
"command": "mcp-tool-search",
"args": ["--mcp-config", "/path/to/config.json"]
}
}
}
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"mcp-tool-search": {
"command": "npx",
"args": ["mcp-tool-search", "--mcp-config", "/path/to/config.json"]
}
}
}
Claude Code
{
"mcpServers": {
"mcp-tool-search": {
"command": "npx",
"args": ["mcp-tool-search", "--mcp-config", "/path/to/config.json"]
}
}
}
Pi (with pi-mcp-extension)
Add to ~/.pi/agent/mcp.json:
{
"mcpServers": {
"mcp-tool-search": {
"command": "node",
"args": ["/path/to/mcp-gateway-proxy/dist/cli.js", "--mcp-config", "/path/to/config.json"],
"lifecycle": "eager"
}
}
}
The proxy connects to all your downstream MCP servers. The Pi extension only needs to know about the proxy — no duplication of tools.
Pi agent → pi-mcp-extension → mcp-tool-search (proxy) → N downstream servers
Proxy Tool Usage
The mcp tool accepts these parameters:
| Parameter | Type | Description |
|---|---|---|
tool |
string | Tool name to call |
args |
string | Arguments as JSON string |
connect |
string | Server name to connect |
describe |
string | Tool name to describe |
search |
string | Search query |
regex |
boolean | Treat search as regex |
includeSchemas |
boolean | Include schemas in search |
server |
string | Filter to server |
action |
string | "ui-messages", "auth-start", "auth-complete" |
Examples
mcp({}) → Show server status
mcp({ server: "filesystem" }) → List tools from server
mcp({ search: "file" }) → Search tools
mcp({ describe: "read_file" }) → Show tool details
mcp({ connect: "github" }) → Connect to server
mcp({ tool: "read_file", args: '{"path":"/foo"}' }) → Call a tool
mcp({ action: "auth-start", server: "linear" }) → Start OAuth
mcp({ action: "auth-complete", server: "linear", args: '{"redirectUrl":"..."}' }) → Complete OAuth
Example Output
mcp({}) →
MCP: 2/5 servers, 38 tools
✓ chrome-devtools (29 tools)
✓ pencil (9 tools)
○ stitch (not connected)
○ tavily (not connected)
○ computer-use (not connected)
mcp({ search: "screenshot" }) →
Found 3 tools matching "screenshot":
chrome_devtools_take_screenshot
Take a screenshot of the page or element.
Parameters: format, quality, uid, fullPage, filePath
pencil_get_screenshot
Returns a screenshot of a node in a .pen file.
Parameters: filePath, nodeId
Configuration Reference
Server Entry
| Field | Type | Description |
|---|---|---|
command |
string | Command to run (stdio) |
args |
string[] | Arguments for command |
env |
Record<string,string> | Environment variables |
url |
string | HTTP/SSE/StreamableHTTP URL |
headers |
Record<string,string> | HTTP headers |
transport |
"stdio" | "http" | "sse" | "streamable-http" | Transport type |
type |
"http" | Alias for transport (standard MCP compatibility) |
oauth |
object | OAuth configuration |
lifecycle |
"lazy" | "eager" | "keep-alive" | Connection mode |
idleTimeout |
number | Idle timeout (seconds) |
directTools |
boolean | string[] | Expose as direct tools |
excludeTools |
string[] | Tools to exclude |
exposeResources |
boolean | Expose resources as tools |
toolPrefix |
"server" | "short" | "none" | Tool name prefix |
requestTimeoutMs |
number | Request timeout |
autoAuth |
boolean | Auto-start OAuth |
bearerToken |
string | Bearer token |
bearerTokenEnv |
string | Env var name for bearer token |
Settings (top-level)
| Field | Type | Description |
|---|---|---|
toolPrefix |
"server" | "short" | "none" | Global tool prefix |
directTools |
boolean | string[] | Global direct tools |
autoAuth |
boolean | Global auto-auth |
idleTimeout |
number | Global idle timeout |
requestTimeoutMs |
number | Global request timeout |
disableProxyTool |
boolean | Disable proxy tool |
authRequiredMessage |
string | Custom auth message |
Environment Variables
| Variable | Description |
|---|---|
MCP_TOOL_SEARCH_DEBUG |
Enable debug logging to stderr |
MCP_TOOL_SEARCH_DATA_DIR |
Data directory override (default: ~/.config/mcp-tool-search/) |
MCP_DIRECT_TOOLS |
Direct tools filter (comma-separated, server/tool or server) |
MCP_TOOL_SEARCH_NPX_CACHE_TTL |
npx cache TTL in ms (default: 24h) |
Architecture
┌──────────────────┐ stdio ┌──────────────────┐
│ MCP Client │◄──────────────►│ mcp-tool-search │
│ (Cursor, etc.) │ JSON-RPC │ (this server) │
└──────────────────┘ └────────┬─────────┘
│
┌──────────────────────────┼──────────────────────────┐
│ │ │
┌─────┴─────┐ ┌──────┴──────┐ ┌──────┴──────┐
│ stdio │ │ HTTP/SSE │ │ Streamable │
│ server │ │ server │ │ HTTP │
└───────────┘ └─────────────┘ └─────────────┘
Development
npm install # Install dependencies
npm run build # Build with tsup → dist/cli.js
npm run typecheck # Type-check with tsc (no emit)
npm test # Run vitest test suite (84 tests)
Build System
The project uses tsup (powered by esbuild) for compilation:
- Source code uses
.tsimport extensions (e.g.,import { foo } from "./types.ts") - tsconfig.json has
noEmit: truefor type-checking only - tsup bundles everything into a single
dist/cli.jsfile (~150KB) - Dependencies (
@modelcontextprotocol/sdk,open,recheck,typebox,zod) are externalized
Project Structure
src/
├── cli.ts # CLI entry point
├── server.ts # MCP server setup + stdio transport
├── state.ts # Gateway state factory
├── config/
│ ├── types.ts # Config types (McpConfig, ServerEntry, etc.)
│ ├── config.ts # Config loader + merge logic
│ ├── imports.ts # Config imports/expand logic
│ └── paths.ts # Config path resolution
├── cache/
│ ├── metadata-cache.ts # Metadata cache (hash-based invalidation)
│ └── tool-metadata.ts # Tool metadata builder + search
├── auth/
│ ├── auth-store.ts # Token storage (secure file permissions)
│ ├── oauth-provider.ts # OAuth client provider
│ ├── oauth-flow.ts # OAuth flow (start, complete, authenticate)
│ └── callback-server.ts # OAuth callback HTTP server
├── mcp/
│ ├── server-manager.ts # MCP server connection manager
│ ├── transport.ts # Transport creation (stdio/HTTP/SSE/StreamableHTTP)
│ └── npx-resolver.ts # npx package resolution (skip npm parent)
├── lifecycle/
│ ├── lifecycle.ts # Lifecycle manager (lazy/eager/keep-alive)
│ └── lazy-connect.ts # Lazy connect with 60s failure backoff
├── guard/
│ └── output-guard.ts # Output truncation (50KiB / 2000 lines)
├── tools/
│ ├── proxy.ts # Proxy tool definition + dispatch
│ ├── proxy-actions.ts # Proxy action handlers (search/describe/call/etc.)
│ ├── direct-tools.ts # Direct tool resolution + executor
│ └── tool-registrar.ts # MCP content transformation
├── handlers/
│ ├── list-tools.ts # ListToolsRequest handler
│ └── call-tool.ts # CallToolRequest handler
└── utils/
├── abort.ts # AbortSignal utilities
├── logger.ts # stderr-only logger
├── env.ts # Environment variable interpolation
└── utils.ts # General utilities (parallelLimit, etc.)
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。