🧠 MCP基本创建工具
最低限度 模型上下文协议(MCP) 演示如何使用创建和注册工具的项目 fastmcp 框架。
此存储库显示了如何构建工作 MCP服务器 它可以将Python函数作为AI客户端的工具公开,例如 克劳德桌面 或任何其他MCP兼容应用程序。
______________________________________________________________________
🚀 特性
- 使用简单的MCP服务器设置
FastMCP - 示例工具实现(
get_weather) - 易于使用更多工具进行扩展
- 已准备好与Claude或ChatGPT集成(通过MCP)
______________________________________________________________________
1.️⃣ 克隆存储库
git clone https://github.com/anilvermaspeaks/mcp-bacis-create-tool.git
cd mcp-bacis-create-tool
Create and activate a virtual environment
python -m venv basics-mcp
To connect this tool to Claude Desktop, add the following entry inside your Claude configuration file:
Config path:
Windows → %APPDATA%\Claude\claude_desktop_config.json
macOS → ~/Library/Application Support/Claude/claude_desktop_config.json
Add this JSON snippet:
{
"mcpServers": {
"mcp-bacis-create-tool": {
"command": "python",
"args": [
"D:/basics-mcp/main.py"
],
"env": {
"PYTHONPATH": "D:/basics-mcp"
}
}
}
}
## run MCP server(main.py) using custom mcp client(client.py)
uv run python client.py```