本项目是一个用于增强上下文(Enrichment)的 Model Context Protocol (MCP) 服务器,主要提供 IP 查询和域名查询功能,能够通过输入 IP 地址或域名来查询相关信息。
git clone git@github.com:yourusername/enrichment-mcp.git
进入项目目录后,安装所需的 Python 包:
pip install -r requirements.txt
创建一个配置文件 config.json
,并添加以下内容:
{
"ip": {
"enable": true,
"apikey": "your_api_key_here",
"apisecretkey": "your_api_secret_key_here"
},
"domain": {
"enable": true,
"apikey": "your_api_key_here",
"apisecretkey": "your_api_secret_key_here"
}
}
有关使用预构建服务器的说明,请参阅:https://modelcontextprotocol.io/quickstart/user
curl -LsSf https://astral.sh/uv/install.sh | sh
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"enrichment-mcp": {
"command": "/ABSOLUTE/PATH/TO/PARENT/FOLDER/uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/CLONED/REPOSITORY/enrichment-mcp",
"run",
"server.py"
]
}
}
}
现在,您应该会在聊天栏中看到两个图标:一个锤子(显示可用工具)和一个连接图标(显示定义的提示和输入要求)。
在构建这个服务器的过程中,开发者学习了 astral 的 uv 以及 MCP。虽然可能存在过度设计的情况,但整个过程十分有趣。同时,开发者考虑到了未来的用途,因此尝试以更通用的方式进行设计(更多细节即将推出)。
此外,特别选择使用 Jinja2 模板,因为这可以更好地管理返回的提示/结果,并为未来用例提供更多灵活性。
欢迎贡献!请随时提交拉取请求。
此工具仅用于教育和授权测试目的。