Python 服务器 MCP - 加密货币价格服务
该项目实现了一个提供加密货币价格信息的 MCP(模型上下文协议)服务器。该服务器使用 Python 和 MCP 框架构建,以创建可供不同客户端使用的 API。
特征
实时加密货币价格检索
基于环境的配置(开发、生产、暂存、本地)
CoinMarketCap API 集成
Docker 容器部署
要求
Python 3.12+
uv(包和虚拟环境管理器)
Docker(可选,用于容器执行)
安装
使用 uv(推荐)
使用 uv 创建并激活虚拟环境
安装依赖项
uv sync
配置
在项目根目录中创建一个
.env
文件,其中包含以下变量:
您还可以为每个环境创建特定的环境文件:
.dev.env
- 用于开发环境.staging.env
- 用于暂存环境.prod.env
- 用于生产环境
用法
本地执行
这将启动 MCP 服务器,该服务器将通过标准输入/输出 (stdio) 监听请求。
使用 Docker
项目结构
发展
向 MCP 服务器添加新工具
要向 MCP 服务器添加新工具,请按照以下步骤操作:
在
src/__init__.py
文件中定义函数在
main()
函数中注册该工具使用文档字符串记录该工具
例子:
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一种加密货币价格服务,通过集成 CoinMarketCap API 的 MCP(模型上下文协议)框架提供实时加密定价信息。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.Last updated -328136MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that provides access to CoinMarketCap's cryptocurrency data, enabling AI applications to retrieve cryptocurrency listings, quotes, and detailed information.Last updated -33
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface. Updated to use Coin Cap API v3Last updated -3431MIT License
- -securityFlicense-qualityA cryptocurrency price query service based on Model Context Protocol that provides tools for retrieving virtual currency prices, market trends, detailed information, and K-line data.Last updated -3