GoSearch MCP服务器
一个MCP服务器,它公开 GoSearch 企业搜索和GoAI作为人工智能助手的工具。建于 FastMCP.
托管HTTP模式
此服务器旨在通过Streamable HTTP作为托管的远程MCP服务器运行。
公共端点形状:```text
https://mcp.gosearch.ai/mcp/
本地开发端点形状:```text
http://localhost:8000/mcp/
认证
托管服务器不使用共享 GOSEARCH_API_TOKEN.
MCP客户端应随每个请求发送每个用户的GoSearch OAuth/API承载令牌:```http
Authorization: Bearer YOUR_TOKEN
MCP服务器将该标头转发到 `api.gosearch.ai`.GoSearch仍负责令牌验证、范围强制、刷新、存储和撤销。
## 本地开发
本项目使用Python `3.12` 和 `uv`.
1. 安装Python `3.12`.
1. 安装 `uv`.
1. 创建本地环境并安装依赖项:```bash
uv sync
- 在本地运行MCP服务器:```bash
uv run fastmcp run src/gosearch_mcp/server.py \
--transport streamable-http \
--host 0.0.0.0 \
--port 8000 \
--path /mcp/
5. 验证健康状况和OAuth发现:```bash
curl http://localhost:8000/health
curl http://localhost:8000/.well-known/oauth-authorization-server
码头工人
在本地构建和运行:bash
docker build -t gosearch-mcp .
docker run --rm -p 8000:8000 gosearch-mcp
工具
| 工具 | 说明 |
|---|---|
search |
搜索Go搜索相关结果 |
goai_response |
从GoAI获取AI生成的响应 |
