Model Context Protocol

KeuHub MCP Server

KeuHub exposes a Model Context Protocol (MCP) server that allows external AI agents to retrieve and analyze financial reports natively.

Server Endpoint

URL/api/mcp
Transport
SSEHTTP

Available Tools

The server provides several tools that AI models can use to retrieve financial data:

search_companies
Search for companies listed on the IDX by their name or stock code.
Parametersquery: string
list_available_reports
List all available financial report periods for a specific company.
ParametersentityId: string
get_financial_report
Get full parsed financial statements for a company. This includes the balance sheet, income statement, cash flow, equity, and ratios.
ParametersentityId: string year: number period: string
get_financial_summary
Get a more compact summary of financial information, key ratios, and chart data for a period.
ParametersentityId: string year: number period: string

Available Resources

The server also exposes financial reports as resource URIs:

keuhub://reports/{entityId}/{year}/{period}

Access the direct JSON representation of the financial statements for a given company, year, and period.

How to Connect

KeuHub's MCP Server uses the WebStandardStreamableHTTPServerTransport over the /api/mcp endpoint.

Programmatic Integration (TypeScript/Node.js)

If you are building an AI client or agent, you can connect to the KeuHub MCP server using the official SDK:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";

async function connectToKeuHub() {
  const transport = new SSEClientTransport(new URL("http://localhost:3000/api/mcp"));
  const client = new Client({
    name: "My AI Client",
    version: "1.0.0"
  }, { capabilities: { tools: {} } });

  await client.connect(transport);
  
  const tools = await client.listTools();
  console.log("Available tools:", tools);
}

Testing with MCP Inspector

You can test the MCP server locally using the official MCP Inspector. Make sure your KeuHub Next.js server is running (npm run dev), then start the inspector: (Note that the inspector will connect to your local Next.js dev server to test the endpoints).

npx @modelcontextprotocol/inspector http://localhost:3000/api/mcp