Skip to main content
Glama
kelvis-santos

MCP Server

index.ts896 B
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { z } from "zod"; import { registerWeatherTools } from "./tools/serverTool.js"; const NWS_API_BASE = "https://api.weather.gov"; const USER_AGENT = "weather-app/1.0"; // Cria instância do servidor MCP const server = new McpServer({ name: "weather", version: "1.0.0", capabilities: { resources: {}, tools: {}, }, }); // Registra as ferramentas (tools) do servidor MCP registerWeatherTools(server, NWS_API_BASE, USER_AGENT); // Inicializa o servidor MCP async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error("Weather MCP Server running on stdio"); } main().catch((error) => { console.error("Fatal error in main():", error); process.exit(1); });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kelvis-santos/MCP-vscode-examples'

If you have feedback or need assistance with the MCP directory API, please join our Discord server