
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@jorgemf/mcp-filter-tools
Advanced tools
A TypeScript MCP proxy server that filters upstream tools using allowlist patterns to reduce token consumption
A TypeScript MCP (Model Context Protocol) proxy server that filters upstream tools using allowlist patterns to dramatically reduce token consumption.
npm install @jorgemf/mcp-filter-tools
Or use directly with npx:
npx @jorgemf/mcp-filter-tools [options]
Filter a local MCP server to expose only specific tools:
npx @jorgemf/mcp-filter-tools \
--transport stdio \
--stdio-command npx \
--stdio-arg -y \
--stdio-arg @modelcontextprotocol/server-filesystem@latest \
--allow-tool read_file \
--allow-tool list_directory
Allow tools matching patterns:
npx @jorgemf/mcp-filter-tools \
--transport stdio \
--stdio-command npx \
--stdio-arg -y \
--stdio-arg @supabase/mcp-server-supabase@latest \
--allow-pattern "^execute_" \
--allow-pattern "^list_" \
--allow-tool get_project
Filter a remote MCP server:
npx @jorgemf/mcp-filter-tools \
--transport sse \
--http-url http://localhost:3000/sse \
--allow-tool tool1 \
--allow-tool tool2
| Option | Alias | Description | Default |
|---|---|---|---|
--transport <type> | -t | Transport type: stdio, sse, or http | stdio |
--stdio-command <cmd> | Command to execute for stdio transport | ||
--stdio-arg <arg> | Arguments for stdio command (can be repeated) | [] | |
--http-url <url> | URL for HTTP/SSE transport | ||
--allow-tool <name> | -a | Exact tool name to allow (can be repeated) | [] |
--allow-pattern <regex> | Regex pattern for tool names (can be repeated) | [] |
Note: At least one --allow-tool or --allow-pattern must be specified.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"filtered-filesystem": {
"command": "npx",
"args": [
"@jorgemf/mcp-filter-tools",
"--transport", "stdio",
"--stdio-command", "npx",
"--stdio-arg", "-y",
"--stdio-arg", "@modelcontextprotocol/server-filesystem@latest",
"--allow-tool", "read_file",
"--allow-tool", "write_file",
"--allow-pattern", "^list_"
]
}
}
}
Note: Claude Desktop may display capabilities: none for this server. This is normal and expected - it means the server has no additional capabilities beyond tools (no prompts, resources, etc.). Your filtered tools will still be available and functional. See CLAUDE_DESKTOP.md for details.
Similar configuration in your MCP settings file.
tools/list requests and filters tools based on allowlisttools/call requests to upstream (only for allowed tools)Reduce 29 tools (~20.8k tokens) to 3 tools (~1.9k tokens) - 91% reduction:
npx @jorgemf/mcp-filter-tools \
--transport stdio \
--stdio-command npx \
--stdio-arg -y \
--stdio-arg @supabase/mcp-server-supabase@latest \
--stdio-arg --access-token \
--stdio-arg YOUR_TOKEN \
--allow-tool execute_sql \
--allow-tool list_tables \
--allow-tool get_project
Expose only read operations:
npx @jorgemf/mcp-filter-tools \
--transport stdio \
--stdio-command npx \
--stdio-arg -y \
--stdio-arg @modelcontextprotocol/server-filesystem@latest \
--allow-pattern "^read_" \
--allow-pattern "^list_"
You can also use the library programmatically:
import { MCPFilterProxy } from '@jorgemf/mcp-filter-tools';
const proxy = new MCPFilterProxy({
transport: {
type: 'stdio',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-filesystem@latest'],
},
filter: {
allowTools: ['read_file', 'write_file'],
allowPatterns: ['^list_'],
},
});
await proxy.start();
# Install dependencies
npm install
# Build
npm run build
# Run in development mode
npm run dev
# Run tests (watch mode)
npm test
# Run tests (single run)
npm run test:ci
# Run only unit tests
npm run test:unit
# Run integration tests
npm run test:integration
# Run E2E tests
npm run test:e2e
# Run all tests
npm run test:all
# Generate coverage report
npm run test:coverage
# Lint
npm run lint
# Format
npm run format
See TEST_GUIDE.md for detailed testing documentation.
| Feature | @jorgemf/mcp-filter-tools | mcp-filter (Python) | @respawn-app/tool-filter-mcp |
|---|---|---|---|
| Language | TypeScript | Python | TypeScript |
| Allowlist | ✅ | ✅ | ❌ |
| Denylist | ❌ | ✅ | ✅ |
| stdio transport | ✅ | ✅ | ❌ |
| HTTP/SSE transport | ✅ | ✅ | ✅ |
| Regex patterns | ✅ | ✅ | ✅ |
| Tool prefixing | ❌ | ✅ | ❌ |
| Health check | ❌ | ✅ | ❌ |
MIT
Contributions are welcome! Please open an issue or submit a pull request.
Inspired by:
FAQs
A TypeScript MCP proxy server that filters upstream tools using allowlist patterns to reduce token consumption
We found that @jorgemf/mcp-filter-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.