About Mcp Server
A Python server offering endpoints for the current USD-to-ruble exchange rate, weather by city, and a weekly news summary. It is intended for clients that need these data through its API.
Key features
- 01Get the USD-to-ruble rate
- 02Fetch weather for a city
- 03Retrieve a weekly news summary
Use cases
- 01Check the current USD-to-ruble rate
- 02Look up weather for a specified city
- 03Fetch recent news articles
MCP support
The README describes an MCP server that provides exchange-rate, weather, and news data; it also documents HTTP API endpoints for these functions.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP (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())
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.