Добавил информацию по курсу рубля
This commit is contained in:
15
mcp-moex.py
15
mcp-moex.py
@@ -3,8 +3,8 @@ from starlette.routing import Mount
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
from typing import TypedDict, List
|
||||
|
||||
|
||||
from moex import bond_sequrities
|
||||
from cbrcurrency import get_currency
|
||||
|
||||
|
||||
mcp = FastMCP("mcp-moex - Данные с московской биржы.", port=8021)
|
||||
@@ -22,5 +22,18 @@ def get_bond_securities(bond_ticker: str, board: str) -> dict:
|
||||
return bond_sequrities(bond_ticker, board)
|
||||
|
||||
|
||||
@mcp.tool()
|
||||
def get_currency_to_rub(currency_charcode: str) -> dict:
|
||||
"""
|
||||
Возвращает курс рубля центробанка России к валюте по ее коду (например, "USD")
|
||||
|
||||
Args:
|
||||
currency_charcode (str): Код валюты (например, "USD", указывается в uppercase).
|
||||
"""
|
||||
return get_currency(currency_charcode)
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
mcp.run(transport="streamable-http", mount_path="/mcp")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user