FastMCP——模型上下文协议服务器
使用 FastMCP 实现的轻量级模型上下文协议 (MCP) 服务器, FastMCP是一个用于构建 MCP 服务器和客户端的快速 Pythonic 框架。
特征
- 创建、检索、更新和删除模型上下文
- 针对特定上下文执行查询
- 按模型名称和标签过滤
- 内存存储(用于开发)
- FastMCP 集成,轻松实现 MCP 服务器开发
- 用于指标和监控的 Datadog 集成
要求
- Python 3.7+
- FastMCP
- uv(推荐用于环境管理)
- Datadog 帐户(可选,用于指标)
安装
使用 uv(推荐)
最简单的安装方法是使用提供的脚本:
Unix/Linux/macOS
视窗
手动安装
Datadog 配置
该服务器与 Datadog 集成,用于指标和监控。您可以通过多种方式配置 Datadog API 凭据:
1.环境变量
启动服务器之前设置这些环境变量:
2. .env 文件
在项目目录中创建.env
文件:
3. FastMCP CLI 安装
当作为 Claude Desktop 工具安装时,您可以传递环境变量:
4.运行时配置
在运行时使用configure_datadog
工具:
用法
启动服务器
安装为 Claude 桌面工具
使用工具
该服务器提供以下工具:
create_context
创建一个新的上下文get_context
- 检索特定上下文update_context
- 更新现有上下文delete_context
- 删除上下文list_contexts
- 列出所有上下文(带有可选过滤)query_model
- 针对特定上下文执行查询health_check
- 服务器健康检查configure_datadog
- 在运行时配置 Datadog 集成
示例请求
创建上下文
执行查询
配置 Datadog
Datadog 指标
服务器向 Datadog 报告以下指标:
mcp.contexts.created
- 上下文创建事件mcp.contexts.updated
- 上下文更新事件mcp.contexts.deleted
- 上下文删除事件mcp.contexts.accessed
- 上下文访问事件mcp.contexts.total
- 上下文总数mcp.contexts.listed
- 列出上下文操作事件mcp.queries.executed
- 查询执行事件mcp.server.startup
- 服务器启动事件mcp.server.shutdown
- 服务器关闭事件
发展
请参阅包含的mcp_example.py
以获取客户端实现示例:
执照
麻省理工学院
资源
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
轻量级模型上下文协议服务器,支持通过集成的 Datadog 指标和监控来创建、管理和查询模型上下文。
Related MCP Servers
- -securityFlicense-qualityA Model Context Protocol server built with mcp-framework that allows users to create and manage custom tools for processing data, integrating with the Claude Desktop via CLI.Last updated -484TypeScript
- -securityAlicense-qualityA Model Context Protocol server that provides file system operations, analysis, and manipulation capabilities through a standardized tool interface.Last updated -1TypeScriptMIT License
- -securityFlicense-qualityA Model Context Protocol server that provides a comprehensive interface for interacting with the ConnectWise Manage API, simplifying API discovery, execution, and management for both developers and AI assistants.Last updated -462Python
- -securityAlicense-qualityA Model Context Protocol server for data wrangling that provides standardized interfaces for data preprocessing, transformation, and analysis tasks including data aggregation and descriptive statistics.Last updated -1PythonMIT License