npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

zenrus-mcp

v1.0.0

Published

MCP server for fetching exchange rates and oil prices from zenrus.ru

Readme

Zenrus MCP Server

MCP-сервер для получения актуальных курсов валют и цен на нефть с сайта zenrus.ru.

Возможности

Сервер предоставляет следующие инструменты:

Базовые инструменты (получение данных)

  • get_usd_rate - Get current USD/RUB exchange rate
  • get_eur_rate - Get current EUR/RUB exchange rate
  • get_brent_usd_rate - Get current Brent crude oil price in USD per barrel
  • get_brent_rub_rate - Get current Brent crude oil price in RUB per barrel

Расчетные инструменты (вычисления)

  • calculate_barrels_for_rub - Calculate how many barrels can be purchased for given amount in RUB
  • calculate_barrels_for_usd - Calculate how many barrels can be purchased for given amount in USD
  • calculate_barrels_for_eur - Calculate how many barrels can be purchased for given amount in EUR

Формат возвращаемых данных

Все инструменты возвращают структурированные JSON данные с числовыми значениями, которые могут быть использованы в вычислениях:

Курсы валют (get_usd_rate, get_eur_rate):

{
  "rate": 81.08,
  "currency": "USD/RUB",
  "description": "US Dollar to Russian Ruble exchange rate"
}

Цены на нефть (get_brent_usd_rate, get_brent_rub_rate):

{
  "price": 62.17,
  "commodity": "Brent Crude Oil",
  "currency": "USD",
  "unit": "per barrel"
}

Расчеты (calculate_barrels_for_rub, calculate_barrels_for_usd, calculate_barrels_for_eur):

{
  "amount": 100000,
  "currency": "RUB",
  "barrels": 19.8374,
  "pricePerBarrel": 5041,
  "commodity": "Brent Crude Oil"
}

Такой подход позволяет AI-модели:

  • Использовать данные в математических вычислениях
  • Форматировать вывод по своему усмотрению
  • Легко парсить и обрабатывать результаты
  • Сохранять семантику данных

Примеры использования

Для расчетных инструментов передавайте параметр amount:

{
  "name": "calculate_barrels_for_usd",
  "arguments": {
    "amount": 1000
  }
}

Результат покажет, сколько баррелей можно купить:

{
  "amount": 1000,
  "currency": "USD",
  "barrels": 16.0848,
  "pricePerBarrel": 62.17,
  "commodity": "Brent Crude Oil"
}

Установка

npm install
npm run build

Использование

Запуск сервера

npm start

Конфигурация для Claude Desktop

Добавьте следующую конфигурацию в файл настроек Claude Desktop:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "zenrus": {
      "command": "node",
      "args": ["E:\\Projects\\zenrus-mcp\\dist\\index.js"]
    }
  }
}

Разработка

# Сборка проекта
npm run build

# Режим разработки с автоматической пересборкой
npm run dev

# Запуск тестов
npm test

# Запуск тестов в watch-режиме
npm run test:watch

# Отладка (выполняет запрос к API и выводит данные)
npm run debug

Отладка

Для проверки работоспособности сервера используйте команду:

npm run debug

Этот скрипт выполнит реальный запрос к zenrus.ru и выведет:

  • Полученные данные в JSON формате
  • Результаты работы каждого MCP-инструмента
  • Статистику выполнения

Структура проекта

zenrus-mcp/
├── src/
│   ├── index.ts              # Основной код MCP сервера
│   ├── api.ts                # API модуль с кешированием
│   ├── debug.ts              # Скрипт для отладки
│   └── __tests__/
│       └── parser.test.ts    # Тесты парсинга данных
├── dist/                     # Скомпилированные файлы
├── package.json
├── tsconfig.json
├── vitest.config.ts
└── README.md

Как это работает

Получение данных

Сервер получает данные с zenrus.ru из JavaScript файла currents.js, который содержит актуальные курсы в формате:

var current = {0:81.08,1:94.15,2:62.17,...}

Где:

  • 0 - курс USD в рублях
  • 1 - курс EUR в рублях
  • 2 - цена Brent в долларах

Цена Brent в рублях вычисляется автоматически: USD * Brent(USD)

Кеширование

Данные кешируются на 60 минут для снижения нагрузки на удаленный API. При каждом запросе:

  1. Проверяется наличие и актуальность кешированных данных
  2. Если данные устарели (прошло > 60 минут), выполняется новый запрос
  3. Новые данные сохраняются в кеш

URL использует Unix timestamp для cache busting: currents.js?v1234567890

Технологии

Лицензия

MIT