What is MCP Server?
MCP Server is a Python-based server that provides real-time currency exchange rates, weather forecasts, and news updates from the past week.
How to use MCP Server?
To use MCP Server, clone the repository, set up a virtual environment, install dependencies, configure API keys, and run the server. The server will be accessible at http://localhost:8000
.
Key features of MCP Server?
- Provides current dollar exchange rates.
- Offers weather forecasts from OpenWeatherMap.
- Delivers news updates from NewsAPI.
- Supports Docker for containerized deployment.
Use cases of MCP Server?
- Fetching real-time currency exchange rates for financial applications.
- Providing weather information for travel planning.
- Aggregating news for informational dashboards.
FAQ from MCP Server?
- What APIs are required to run MCP Server?
You need API keys from exchangerate-api.com, openweathermap.org, and newsapi.org.
- Is MCP Server easy to set up?
Yes! Follow the installation instructions in the repository to get started quickly.
- Can I run MCP Server in a Docker container?
Yes! The repository includes Docker files for easy containerization.
MCP Server
MCP сервер на Python, предоставляющий текущий курс доллара, прогноз погоды и новости за последнюю неделю.
Установка
-
Клонируйте репозиторий:
git clone https://github.com/Cavumnigrum/mcp_server_project.git cd mcp_server_project
-
Создайте виртуальное окружение:
python -m venv venv source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows
-
Установите зависимости:
pip install -r requirements.txt
-
Настройте API ключи:
- Зарегистрируйтесь на:
- exchangerate-api.com для курса доллара.
- openweathermap.org для погоды.
- newsapi.org для новостей.
- Скопируйте
.env.example
в.env
и заполните своими ключами:cp .env.example .env
- Зарегистрируйтесь на:
-
Запустите сервер:
python mcp_server.py
Сервер будет доступен по адресу
http://localhost:8000
.
Тестирование
Запустите тесты с помощью pytest
:
pytest test_mcp_server.py -v
Подключение клиента
Самописный клиент:
python mcp_client.py
- При запуске клиента есть инструкция как им пользоваться
Дополнительно
В репозитории есть docker-файлы для создания контейнеров. Порядок работы с докер-файлами:
- Убедиться, что установлены необходимые пакеты для docker и docker-compose
- Перейти в папку с проектом
cd path\to\project
- Запустить docker-compose файл в двух режимах для сервера и клиента
docker-compose up -d server docker-compose run --rm client
- После завершения работы можно уронить контейнеры с помощью
docker-compose down server client