使用说明
MCP服务器 - 独立模型上下文协议服务器实现
这是一个独立的模型上下文协议(MCP)服务器实现。它为以下方面提供了MCP服务器实现:
- Wolfram Alpha查询计算智能以获取数学和科学答案
项目结构
mcp-server/
├── cmd/
│ └── cli/ # CLI entry point and command handlers
│ ├── main.go # Application entry point
│ ├── root.go # Root command definition
│ └── mcp.go # MCP server commands (source, target, wolfram)
├── internal/
│ ├── mcp/ # MCP server implementation
│ │ ├── server.go # MCP server core
│ │ ├── protocol.go # MCP protocol handler
│ │ └── wolfram.go # Wolfram Alpha integration
│ └── migration/ # Shared migration utilities
│ ├── introspection/ # Database introspection
│ └── remote/ # SSH tunnel support
├── go.mod # Go module definition
└── README.md # This file
入门指南/开始使用
先决条件
- Go 1.21或更高版本
- Wolfram Alpha API密钥(用于Wolfram MCP服务器)
安装
git clone <repo-url>
cd mcp-server
go mod tidy
go build -o mcp-server ./cmd/cli
使用
启动Wolfram Alpha MCP服务器
export WOLFRAM_API_KEY=your-api-key-here
export MCP_WOLFRAM_PORT=8083
./mcp-server mcp wolfram
配置
环境变量
MCP服务器端口
MCP_WOLFRAM_PORT- Wolfram Alpha MCP 服务器的端口(默认:stdio)
Wolfram Alpha
WOLFRAM_API_KEY- 来自Wolfram Alpha的API密钥(必需)
可用工具
Wolfram Alpha服务器
- 查询Wolfram - 向Wolfram Alpha查询计算答案
示例
查询Wolfram Alpha
curl -X POST http://localhost:8083/mcp \
-H 'Content-Type: application/json' \
-d '{
"method": "tools/call",
"params": {
"name": "query_wolfram",
"arguments": {"query": "integrate x^2 from 0 to 1"}
}
}'
MCP协议支持
- 初始化设置和握手
- Ping健康检查
- 工具/列表发现可用工具
- 工具/呼叫执行工具
- 资源/列表列出可用的数据库资源(表)
- 资源/阅读读取表格信息
建筑
# Build the binary
go build -o mcp-server ./cmd/cli
# Run tests (if any)
go test ./...
# Create a release build
go build -ldflags="-s -w" -o mcp-server ./cmd/cli
与人工智能助手的集成
Claude Desktop(可译为“Claude桌面版”或根据具体语境简化为“Claude桌面”)
添加到 ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"wolfram-alpha": {
"command": "bash",
"args": [
"-c",
"WOLFRAM_API_KEY=your-key MCP_WOLFRAM_PORT=8083 /path/to/mcp-server mcp wolfram"
]
}
}
}
安全考虑事项
- 永远不要将API密钥或数据库凭据提交到版本控制系统中
- 使用环境变量或
.env用于管理密钥的文件 - 对于HTTP模式,请确保服务器仅监听本地主机或在认证之后
- SSH隧道提供安全的远程数据库访问
- 保持二进制文件和依赖项更新
许可证
[在此指定您的许可证]
做出贡献
[如需添加,请附上贡献指南]
相关项目
这是从……中提取的 CIWG-Zoho迁移 项目。有关完整的迁移系统,请参阅该存储库。
支持
如需报告问题、提出疑问或建议,请参考主项目仓库。
