Fangorn MCP服务器
一个MCP(模型上下文协议)服务器,允许AI代理查询Fangorn子图模式和数据源发布的一致数据。
设置
pnpm i
cp env.example .env
# Edit .env and set SUBGRAPH_URL and SUBGRAPH_API_KEY (if calling published Subgraph)
pnpm build码头工人
要构建docker镜像,请运行:
docker build -f Dockerfile \
-t us-central1-docker.pkg.dev/lucky-lead-489114-d7/fangorn-network/mcp:latest .其中标记是您所需的注册表/namespace,例如用于GCP docker映像注册表 us-central1-docker.pkg.dev/lucky-lead-489114-d7
跑步
本地(stdio)
pnpm start
# or
TRANSPORT=stdio node build/index.js远程(流式HTTP)——用于网络代理
TRANSPORT=http PORT=4000 node build/index.js
# Server listens at http://localhost:4000/mcp码头工人
配置.env后,从root运行:
docker compose up远程客户端连接
在HTTP模式下运行时,客户端连接到 http://localhost:4000/mcp 使用流式HTTP传输。
调试
使用MCP检查器交互式测试工具:
pnpm inspect