Python Server MCP
Python Server MCP - Сервис цен на криптовалюту
Этот проект реализует сервер MCP (Model Context Protocol), который предоставляет информацию о ценах криптовалют. Сервер создан с использованием Python и фреймворка MCP для создания API, который может использоваться различными клиентами.
Докер
Сборка Docker: docker build -t mcp/python-server-mcp -f Dockerfile .
Добавьте в файл mcp.json следующее:
{
"mcpServers": {
"python-server-mcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"8000:8000",
"-e",
"ENVIRONMENT",
"-e",
"COINMARKETCAP_API_KEY",
"mcp/python-server-mcp"
],
"env": {
"ENVIRONMENT": "PRODUCTION",
"COINMARKETCAP_API_KEY": "your-api-key",
}
}
}
}Related MCP server: Coin MCP Server
Функции
Получение цен криптовалют в режиме реального времени
Конфигурация на основе среды (разработка, производство, подготовка, локальная)
Интеграция API CoinMarketCap
Развертывание Docker-контейнера
Требования
Питон 3.12+
uv (менеджер пакетов и виртуальной среды)
Docker (опционально, для выполнения контейнера)
Установка
Использование УФ (рекомендуется)
# Clone the repository
git clone <repository-url>
cd PythonServerMcpСоздать и активировать виртуальную среду с помощью УФ
uv venv
source .venv/bin/activateУстановить зависимости
uv sync
Конфигурация
Создайте файл
.envв корне проекта со следующими переменными:
ENVIRONMENT=DEV # Options: LOCAL, DEV, STAGING, PROD
COINMARKETCAP_API_KEY=your_api_key_hereВы также можете создать специальные файлы среды для каждой среды:
.dev.env— для среды разработки.staging.env— для промежуточной среды.prod.env— для производственной среды
Использование
Местное исполнение
python main.pyЭто запустит сервер MCP, который будет прослушивать запросы через стандартный ввод/вывод (stdio).
Использование Докера
# Build the image
docker build -t test-mcp -f Dockerfile --platform linux/amd64 .
# Run the container
docker run -it test-mcpСтруктура проекта
.
├── main.py
└── src
├── __init__.py
├── core
│ ├── common
│ │ ├── crypto_schema.py
│ │ └── schema.py
│ ├── config.py
│ ├── settings
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── development.py
│ │ ├── environment.py
│ │ ├── local.py
│ │ ├── production.py
│ │ └── staging.py
│ └── utils
│ ├── datetime.py
│ ├── extended_enum.py
│ ├── filename_generator.py
│ ├── passwords.py
│ ├── query_utils.py
│ └── redis.py
├── mcp_server.py
├── resources
│ ├── __init__.py
│ └── coinmarketcap_resource.py
├── server.py
├── services
│ ├── __init__.py
│ └── coinmarketcap_service.py
└── tools
├── __init__.py
└── prices.pyРазработка
Добавление новых инструментов на сервер MCP
Чтобы добавить новый инструмент на сервер MCP, выполните следующие действия:
Определите функцию в файле
src/__init__.pyЗарегистрируйте инструмент в функции
main()Документируйте инструмент с помощью строк документации
Пример:
@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 resultThis server cannot be installed
Maintenance
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
- AlicenseBqualityAmaintenanceA 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.322439MIT
- Flicense-qualityFmaintenanceA Model Context Protocol server that provides access to CoinMarketCap's cryptocurrency data, enabling AI applications to retrieve cryptocurrency listings, quotes, and detailed information.37
- Flicense-qualityDmaintenanceA 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
- Alicense-qualityDmaintenanceA 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.91MIT
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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