UNPKG

mcp-banka

Version:

Model Context Protocol Server for Turkish Currency and Exchange Rate data from the Central Bank of The Republic of Turkey (TCMB) (TCMB)

25 lines (24 loc) 1.27 kB
#!/usr/bin/env node import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { todayExchangeRateSchema, todayExchangeRateHandler, exchangeRateHistorySchema, exchangeRateHistoryHandler, getAllCurrenciesSchema, getAllCurrenciesHandler, getExchangeRateUrlSchema, getExchangeRateUrlHandler } from "./tools.js"; // Create MCP Server const server = new McpServer({ name: 'mcp-banka', version: '1.0.0', description: 'Access Turkish Currency and Exchange Rate data from the Central Bank of The Republic of Turkey (TCMB).' }); // Register all tools server.tool("todayExchangeRate", todayExchangeRateSchema, todayExchangeRateHandler); server.tool("exchangeRateHistory", exchangeRateHistorySchema, exchangeRateHistoryHandler); server.tool("getAllCurrencies", getAllCurrenciesSchema, getAllCurrenciesHandler); server.tool("getExchangeRateUrl", getExchangeRateUrlSchema, getExchangeRateUrlHandler); // Start the server with stdio transport async function startServer() { const transport = new StdioServerTransport(); await server.connect(transport); } startServer().catch(error => { console.error('Error starting server:', error); process.exit(1); });