modelscope·@gabrielpierobon/mcp
暂无描述。
一个使用FastMCP 2.0构建的全面模型上下文协议(MCP)服务器,为AI代理提供了访问强大工具和服务套件的能力。这个模块化、可扩展的服务器能够与各种平台、API和自动化工作流无缝集成。
模型上下文协议(MCP)允许AI代理通过标准化接口与外部工具和服务进行交互。此实现提供了一个丰富的工具包,使AI代理能够:
bash
git clone <repository-url> cd mcp-server
uv venv source .venv/bin/activate # 在Windows上: .venvScriptsactivate uv pip install -r requirements.txt
pip install -r requirements.txt
在项目根目录下创建.env文件:
env
MCP_SERVER_NAME=my-mcp-server MCP_HOST=0.0.0.0 MCP_PORT=8000
BRAVE_API_KEY=your_brave_search_api_key AIRTABLE_PERSONAL_ACCESS_TOKEN=your_airtable_token
GOOGLE_CREDENTIALS_FILE=credentials.json GOOGLE_TOKEN_FILE=token.json
为了增强功能,请安装额外的工具:
bash
pip install crawl4ai playwright playwright install
pip install google-auth google-auth-oauthlib google-auth-httplib2 google-api-python-client
bash python run.py
您的服务器将可用:
http://localhost:8000http://localhost:8000/sse| 类别 | 工具 | 需要API | 状态 | |----------|-------|--------------|--------|| 搜索与网络 | 2 个网页搜索工具 | Brave API | ✅ 核心 | | 天气 | 全球天气数据 | 无(Open-Meteo) | ✅ 核心 | | 计算器 | 算术运算 | 无 | ✅ 核心 | | 文件系统 | 5 个文件/目录工具 | 无 | ✅ 核心 | | 网页自动化 | 3 个爬虫 + 10 个浏览器工具 | 无(本地) | ⚡ 可选 | | Airtable | 15+ 数据库工具 | Airtable Token | ✅ 核心 | | Google 表格 | 8 个电子表格工具 | Google OAuth2 | ⚡ 可选 | | Google 文档 | 5 个文档工具 | Google OAuth2 | ⚡ 可选 | | Google 幻灯片 | 10 个演示文稿工具 | Google OAuth2 | ⚡ 可选 |
brave_web_search, brave_local_search - 网页和本地商业搜索get_weather - 任何地点的当前天气和预报calculator - 基本算术及错误处理get_system_info, read_file, list_directory - 文件系统探索create_airtable_base, list_records, 等 - 数据库管理~ 代表主目录,跨平台路径http://your-server:8000/ssejson { "endpoint": "http://localhost:8000/sse", "authentication": "bearer", "tools": ["brave_web_search", "get_weather", "read_file", "create_google_sheet"] }
在您的 Claude 桌面配置中添加:
json { "mcpServers": { "enhanced-mcp-server": { "command": "python", "args": ["/absolute/path/to/run.py"], "env": { "BRAVE_API_KEY": "your_brave_api_key", "AIRTABLE_PERSONAL_ACCESS_TOKEN": "your_airtable_token" } } } }
通过 HTTP API 连接并接收 JSON 响应:
python import httpx
async def call_mcp_tool(): async with httpx.AsyncClient() as client: response = await client.post( "http://localhost:8000/messages", json={ "tool": "list_directory", "parameters": {"directory_path": "~"} } ) return response.json()
安全的只读访问本地文件:
~ 代表主目录和环境变量即时创建生产就绪的基础:
无缝文档创建和管理:
强大的浏览器控制以执行复杂任务:
tools/ 目录下创建一个新的工具文件:python
from typing import Dict, Any
async def my_function(param: str) -> Dict[str, Any]: """AI代理的工具描述。""" try: result = f"Processed: {param}" return {"result": result, "status": "success"} except Exception as e: return {"error": str(e), "status": "error"}
def register(mcp_instance): mcp_instance.tool()(my_function)
run.py 中导入并注册:python from tools import my_tool my_tool.register(mcp)
bash
pip install pytest python-dotenv
pytest tests/
python -m tests.test_mcp_crawler
Brave 搜索 API (获取API密钥)
Airtable 个人访问令牌 (生成令牌)
Google Workspace APIs (设置指南)
一个由FastMCP驱动的服务器,用于通过编程方式创建、编辑和渲染PowerPoint(PPTX)演示文稿,具有幻灯片创建、内容插入和PNG渲染等功能。
赋予AI代理在项目背景下使用灵活的MCP工具安全读取和提取PDF文件中的信息(文本、元数据、页数)的能力。
一种模型上下文协议服务器,通过 Graph API 实现与 Microsoft 365 服务(Excel、日历、邮件、OneDrive、Teams 等)的交互,使人工智能助手能够通过自然语言管理 Microsoft 365 资源。
暂无描述。
暂无描述。
暂无描述。