Skip to main content
Glama
stevearagonsite

Python Server MCP

Python 服务器 MCP - 加密货币价格服务

该项目实现了一个提供加密货币价格信息的 MCP(模型上下文协议)服务器。该服务器使用 Python 和 MCP 框架构建,以创建可供不同客户端使用的 API。

特征

  • 实时加密货币价格检索

  • 基于环境的配置(开发、生产、暂存、本地)

  • CoinMarketCap API 集成

  • Docker 容器部署

Related MCP server: Coin MCP Server

要求

  • Python 3.12+

  • uv(包和虚拟环境管理器)

  • Docker(可选,用于容器执行)

安装

使用 uv(推荐)

# Clone the repository
git clone <repository-url>
cd PythonServerMcp

使用 uv 创建并激活虚拟环境

uv venv
source .venv/bin/activate

安装依赖项

uv sync

配置

  1. 在项目根目录中创建一个.env文件,其中包含以下变量:

ENVIRONMENT=DEV  # Options: LOCAL, DEV, STAGING, PROD
COINMARKETCAP_API_KEY=your_api_key_here
  1. 您还可以为每个环境创建特定的环境文件:

    • .dev.env - 用于开发环境

    • .staging.env - 用于暂存环境

    • .prod.env - 用于生产环境

用法

本地执行

python main.py

这将启动 MCP 服务器,该服务器将通过标准输入/输出 (stdio) 监听请求。

使用 Docker

# Build the image
docker build -t test-mcp -f Dockerfile --platform linux/amd64 .

# Run the container
docker run -it test-mcp

项目结构

.
├── Dockerfile          # Docker configuration
├── main.py             # Application entry point
├── pyproject.toml      # Dependencies configuration
├── start.sh            # Docker startup script
└── src/                # Source code
    ├── __init__.py     # MCP server initialization
    └── core/           # Core modules
        ├── common/     # Shared schemas and models
        ├── config.py   # Application configuration
        ├── services/   # Application services
        ├── settings/   # Environment-specific settings
        └── utils/      # Utilities

发展

向 MCP 服务器添加新工具

要向 MCP 服务器添加新工具,请按照以下步骤操作:

  1. src/__init__.py文件中定义函数

  2. main()函数中注册该工具

  3. 使用文档字符串记录该工具

例子:

@server.add_tool
def my_new_tool(parameter1: str, parameter2: int) -> str:
    """
    Description of what the tool does.
    
    Args:
        parameter1: Description of parameter 1
        parameter2: Description of parameter 2
        
    Returns:
        Description of what is returned
    """
    # Tool implementation
    return result
A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    B
    quality
    A
    maintenance
    A 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.
    3
    224
    39
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A 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.
    3
  • A
    license
    -
    quality
    D
    maintenance
    A server that provides real-time cryptocurrency data through the Model Context Protocol, allowing access to detailed exchange information and current cryptocurrency rates from the CoinCap API.
    9
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Crypto Feeds MCP.

  • CoinMarketCap MCP — crypto prices, market cap, rankings

  • Crypto MCP with 21 tools for market data, DeFi, analytics, and sentiment. Post-paid USDC billing.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/stevearagonsite/PythonServerMcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server