
MCP (Multi-Functional Command Processor) сервер предоставляет API для получения текущего курса доллара, прогноза погоды в заданном городе и сводки новостей за последнюю неделю.
Возможности
- Курс доллара: Получение текущего курса доллара к рублю.
- Прогноз погоды: Получение текущей погоды в указанном городе.
- Сводка новостей: Получение новостей за последнюю неделю.
Установка и запуск
Предварительные требования
- Python 3.7 или выше
- Установленный
pip
Установка
-
Клонируйте репозиторий:
git clone https://github.com/VenGr0/mcp-server.git cd mcp-server
-
Создайте виртуальное окружение и активируйте его:
python -m venv venv source venv/bin/activate # Для Linux/MacOS venv\Scripts\activate # Для Windows
-
Установите зависимости:
pip install -r requirements.txt
Запуск сервера
Запустите сервер:
python server.py
Сервер будет доступен по адресу http://127.0.0.1:5000
.
Запуск тестов
Для запуска тестов выполните:
pytest tests/test_server.py
Использование API
Получение курса доллара
Запрос:
GET /exchange_rate
Ответ:
{
"usd_rate": 75.50
}
Получение прогноза погоды
Запрос:
GET /weather?city=Moscow
Ответ:
{
"weather": "clear sky",
"temperature": 20
}
Получение сводки новостей
Запрос:
GET /news
Ответ:
{
"articles": [
{
"title": "Новость 1",
"description": "Описание новости 1",
"url": "https://example.com/news1"
},
{
"title": "Новость 2",
"description": "Описание новости 2",
"url": "https://example.com/news2"
}
]
}
Подключение клиента
Пример клиента на Python:
import requests
BASE_URL = 'http://127.0.0.1:5000'
def get_exchange_rate():
response = requests.get(f'{BASE_URL}/exchange_rate')
return response.json()
def get_weather(city):
response = requests.get(f'{BASE_URL}/weather?city={city}')
return response.json()
def get_news():
response = requests.get(f'{BASE_URL}/news')
return response.json()
if __name__ == '__main__':
print(get_exchange_rate())
print(get_weather('Moscow'))
print(get_news())
相关推荐
I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.
I find academic articles and books for research and literature reviews.
Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.
Confidential guide on numerology and astrology, based of GG33 Public information
Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.
Advanced software engineer GPT that excels through nailing the basics.
Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
L'application tout-en-un desktop et Docker AI avec chiffon intégré, agents AI, constructeur d'agent sans code, compatibilité MCP, etc.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Plateforme d'automatisation de workflow à code équitable avec des capacités d'IA natives. Combinez le bâtiment visuel avec du code personnalisé, de l'auto-hôte ou du cloud, 400+ intégrations.
🧑🚀 全世界最好的 LLM 资料总结 (数据处理、模型训练、模型部署、 O1 模型、 MCP 、小语言模型、视觉语言模型) | Résumé des meilleures ressources LLM du monde.
Une liste organisée des serveurs de protocole de contexte de modèle (MCP)
Reviews

user_tYNbZZH2
As a dedicated user of mcp-server, I must say it has significantly streamlined my server management tasks. The user-friendly interface and efficient functionality developed by VenGr0 make it a standout in its category. Highly recommend checking it out on GitHub!