Cover image
Try Now
2025-03-19

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

MCP (Multi-Functional Command Processor) сервер предоставляет API для получения текущего курса доллара, прогноза погоды в заданном городе и сводки новостей за последнюю неделю.

Возможности

  • Курс доллара: Получение текущего курса доллара к рублю.
  • Прогноз погоды: Получение текущей погоды в указанном городе.
  • Сводка новостей: Получение новостей за последнюю неделю.

Установка и запуск

Предварительные требования

  • Python 3.7 или выше
  • Установленный pip

Установка

  1. Клонируйте репозиторий:

    git clone https://github.com/VenGr0/mcp-server.git
    cd mcp-server
    
  2. Создайте виртуальное окружение и активируйте его:

    python -m venv venv
    source venv/bin/activate  # Для Linux/MacOS
    venv\Scripts\activate     # Для Windows
    
  3. Установите зависимости:

    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())

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    3 (1)
    Avatar
    user_tYNbZZH2
    2025-04-16

    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!