MCP ExplorerExplorer

Go Mcp Server Financeiro

@tadrianoneton 22 days ago
1 MIT
FreeCommunity
AI Systems
Exemplo prático de construção de um MCP Server em Go, com registro dinâmico de ferramentas financeiras, consultas reais à API Alpha Vantage e exposição de metadados para agentes clientes. Projeto focado em modularidade, extensibilidade e padronização seguindo o Model Context Protocol (MCP).

Overview

What is Go Mcp Server Financeiro

go-mcp-server-financeiro is a practical example of building an MCP Server in Go, focused on the dynamic registration of financial tools, real-time stock price queries using the Alpha Vantage API, and exposing metadata for client agents. The project emphasizes modularity, extensibility, and standardization following the Model Context Protocol (MCP).

Use cases

Use cases include developing financial dashboards, integrating real-time stock price queries into applications, and providing a modular backend for financial services.

How to use

To use go-mcp-server-financeiro, clone the repository, create a .env file with your Alpha Vantage API key, install dependencies using ‘go mod tidy’, and run the server with ‘go run cmd/main.go’. The server will be available at http://localhost:8080.

Key features

Key features include dynamic registration of financial tools, listing all registered tools, querying real-time stock prices from Alpha Vantage, and exposing metadata in the MCP standard for client agents.

Where to use

go-mcp-server-financeiro can be used in financial applications, investment platforms, and any software requiring real-time stock market data and financial tool management.

Content

MCP Server Financeiro

Este projeto é um exemplo prático de como construir um MCP Server simples utilizando Go.
Ele simula a gestão de ferramentas financeiras e realiza consultas reais de cotações de ações utilizando a API pública da Alpha Vantage.

O objetivo é mostrar como estruturar um servidor que siga os princípios básicos do Model Context Protocol (MCP), incluindo a exposição de um endpoint /metadata.

Funcionalidades

  • Registrar ferramentas financeiras dinamicamente
  • Listar todas as ferramentas registradas
  • Consultar preços de ações em tempo real (Alpha Vantage)
  • Expor metadados no padrão MCP para agentes clientes

Estrutura de Endpoints

1. Registrar ferramenta financeira

POST http://localhost:8080/register-financial-tool
Content-Type: application/json

{
  "name": "Consulta Ações",
  "description": "Consulta cotações de ações em tempo real",
  "endpoint": "https://www.alphavantage.co/query",
  "service_type": "cotacao"
}

2. Listar ferramentas financeiras

GET http://localhost:8080/list-financial-tools
Accept: application/json

3. Consultar preço de uma ação (Alpha Vantage)

POST http://localhost:8080/query-stock-price
Content-Type: application/json

{
  "symbol": "AAPL"
}

4. Consultar metadados do MCP Server

GET http://localhost:8080/metadata
Accept: application/json

Pré-requisitos

Como rodar o projeto

  1. Clone o repositório
git clone https://github.com/seuusuario/go-mcp-server-financeiro.git
cd go-mcp-server-financeiro
  1. Crie um arquivo .env na raiz do projeto:
ALPHA_VANTAGE_API_KEY=sua_api_key_aqui
  1. Instale as dependências
go mod tidy
  1. Rode o servidor
go run cmd/main.go

O servidor ficará disponível em http://localhost:8080.

Tools

No tools

Comments