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
/api/mcpAvailable Tools
The server provides several tools that AI models can use to retrieve financial data:
query: stringentityId: stringentityId: string
year: number
period: stringentityId: string
year: number
period: stringAvailable 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