MCPSmartProxy
具有语义工具搜索的令牌高效MCP服务器网关
   
mcp名称:io.github.daedalus/mcp-smart-proxy
安装
pip install mcp-smart-proxy用法
from mcp_smart_proxy import ProxyConfig
config = ProxyConfig.from_file("proxy.yaml")命令行界面
mcp-smart-proxy --help
mcp-smart-proxy serve --config proxy.yaml
mcp-smart-proxy serve --config proxy.yaml --watch ./servers/
mcp-smart-proxy serve --config proxy.yaml --transport streamable-http --host 0.0.0.0 --port 8000
mcp-smart-proxy index --config proxy.yaml
mcp-smart-proxy status --config proxy.yaml
mcp-smart-proxy validate --config proxy.yaml这 --watch 选项监视目录 .yaml, .yml,或 .json 包含以下内容的文件 上游服务器配置。添加、修改或删除文件以动态更新 运行时可用的服务器。
运输选项
这 --transport 选项支持:
stdio(默认)-本地MCP客户端的标准输入/输出传输
API
配置
ProxyConfig-主要配置模型UpstreamConfig-上游服务器配置EmbeddingConfig-嵌入后端配置VectorStoreConfig-矢量存储后端配置
模型
ListResult-结果来自list工具SearchResult-结果来自search工具ToolResult-工具调用结果
发展
git clone https://github.com/daedalus/mcp-smart-proxy.git
cd mcp-smart-proxy
pip install -e ".[test]"
# run tests
pytest
# format
ruff format src/ tests/
# lint
ruff check src/ tests/
# type check
mypy src/