neuro-san mcp示例
该存储库包含各种语言的MCP服务器的简单示例,并将其与neuro-san连接。
所有示例MCP服务器都配置为在 http://127.0.0.1:8000/mcp URL并公开相同的核心工具。neuro-san项目示例见 neuro-san-server 目录,预先配置为在该URL连接到MCP服务器。包括一个示例代理网络调用脚本,预先配置用于调用BMI计算工具。
请阅读 完整的神经SAN MCP指南 了解更多信息。
先决条件
- Python 3.10+
- Java 21+(仅当使用Java MCP服务器时)
- 一 OpenAI API密钥 在您的环境中设置:
export OPENAI_API_KEY=your-key-here神经毒剂使用OpenAI(gpt-5.2)默认情况下。您可以在中更改模型或提供程序 neuro-san-server/registries/llm_config.hocon.
步骤
- 开始任何 一 下面列出的MCP服务器(使用您喜欢的语言)。
- 安装neuro-san服务器依赖项:
pip install -r neuro-san-server/requirements.txt- 运行示例代理:
python neuro-san-server/run_basic_mcp_agent.pyMCP服务器
您可以使用以下命令验证您的MCP服务器是否正在运行:
npx -y @modelcontextprotocol/inspector --cli http://127.0.0.1:8000/mcp --method tools/list它应该返回服务器公开的工具列表,例如:
{
"tools": [
{
"name": "calculate_bmi",
"description": "Calculate BMI given weight in kg and height in meters",
"inputSchema": {
"type": "object",
"properties": {
"weight": { "type": "number" },
"height": { "type": "number" }
},
"required": ["weight", "height"]
}
}
]
}下面列出了可用的MCP服务器示例。
python
位于目录中: python/
安装依赖项:
pip install -r python/requirements.txt启动服务器:
python python/start_mcp_server.py暴露的工具: calculate_bmi
Java
位于目录中: java/
启动服务器:
cd java && mvn spring-boot:run暴露的工具: calculateBmi, getTemperature, getGreeting
看 java/README.md 了解更多详情。
C
位于目录中: cpp/
构建服务器:
cd cpp
cmake -B build && cmake --build build启动服务器:
./build/mcp_server暴露的工具: calculate_bmi, get_temperature, get_greeting
看 cpp/README.md 了解更多详情。
