测试
使用Smithery构建的MCP服务器。
先决条件
- Smithery API密钥获取您的(产品/服务)请访问 smithery.ai/account/api-keys 翻译为中文是:“smithery.ai 账户/API密钥”
入门指南
- 运行服务器:
uv run dev- 交互式测试:
uv run playground尝试说“向约翰问好”来测试这个示例工具。
使用 Docker 运行
从项目根目录构建镜像:
docker build -t hello-server .运行容器:
docker run --rm -p 8081:8081 --shm-size=1g hello-server注:
- 服务器监听在
0.0.0.0:8081并为MCP终端提供服务,位于/mcp。 --shm-size=1g提高了基于Playwright/Firefox的网页抓取功能的浏览器稳定性。
现在,您可以将MCP客户端连接到:
http://localhost:8081/mcp发展
你的服务器代码在 src/hello_server/server.py在那里添加或更新您的服务器功能。
部署
准备部署了吗?将代码推送到GitHub,然后部署到Smithery:
- 在(指定位置)创建一个新仓库
- 初始化 Git 并推送到 GitHub:
git add .
git commit -m "Hello world 👋"
git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
git push -u origin main