MCP Python Server — API-оболочка
В этом проекте создается MCP-сервер на Python, который предоставляет инструмент для запросов к внешнему API. Совместимо с Claude Desktop или ChatGPT Desktop, которые поддерживают протокол контекста модели (MCP).
✨ Особенности
- Демонстрация инструмента через MCP
- HTTP-запрос к внешнему API
- Прямая интеграция с Claude/Desktop через claude.json
🚀 Требования
- Питон 3.9+
- mcp[cli] (устанавливается через pip или uv)
- Claude или ChatGPT Desktop (с поддержкой MCP)
📁 Структура проекта
⚙️ Установка
С пипом
С УФ (рекомендуется)
Установка МКП
Установка с .env
Установка зависимостей
Переменные среды
Создайте файл .env
в корне проекта для определения необязательных переменных среды:
👷 Быстрый старт (Quickstart)
Создайте сервер server.py
Запустить локально в режиме разработки
Запуск в производственном режиме
Или с помощью uv:
🚀 Интеграция с Claude/Desktop
Найдите claude.json в папке конфигурации Claude/Desktop:
- В Windows: %APPDATA%\Claude\claude.json
- В Linux/macOS: ~/.claude/claude.json
Пример:
🤖 Использовать в Claude/Desktop
Вы можете задать вопрос модели:
Используйте инструмент consult_api с параметром «ping»
А модель будет использовать ваш MCP-сервер для совершения HTTP-вызовов в реальном времени.
🎁 Бонус: Расширение инструментов
🔍 Ресурсы
- Официальная документация MCP: https://docs.mcp.run/
- Репозиторий Python SDK: https://github.com/modelcontextprotocol/mcp
✅ Сделано с любовью и httpx 🚀
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.
Сервер Python, реализующий протокол контекста модели, который предоставляет инструменты для запросов к внешним API, совместимый с Claude Desktop и ChatGPT Desktop.
Related MCP Servers
- -securityAlicense-qualityA Python-based server that implements the Model Context Protocol to interface with Claude Desktop as an MCP client, supporting interaction through efficient memory management.Last updated -1PythonMIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -5Python
- -securityAlicense-qualityA streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.Last updated -15PythonMIT License
- AsecurityFlicenseAqualityA Python-based Model Context Protocol server that integrates with Claude Desktop, allowing users to connect to Hubble API services by configuring the server with their Hubble API key.Last updated -7Python