Skip to content
TotalFinance

Docs MCP server

Give an AI agent searchable, citable access to these docs over the Model Context Protocol.

These docs are also an MCP server. An agent connected to it can search the documentation, read any page as Markdown and fetch the complete contract of any export, so it writes code against the real API instead of guessing. It is read-only and stateless, and it never computes finance: for calculations, connect the TotalFinance MCP server, which runs the library locally.

Tools

ToolWhat it returns
search_docsRanked pages, functions, types, calculators and operations for a query, with URLs.
read_pageThe Markdown of one docs page (the same text as its .md twin).
get_referenceThe full generated contract of an export or entry point: signature, members with units and declared defaults, examples and stability.
list_calculatorsThe live calculators, their inputs and the APIs they call.

Connect

The endpoint speaks MCP over Streamable HTTP at /docs/totalfinance/mcp on the host that serves these docs. Nothing to install: pick your client.

These docs as a hosted MCP server: search them, read any page and fetch the full contract of any export, so your agent writes code against the real API. Nothing to install.

Run in your terminal
claude mcp add --transport http totalfinance-docs https://www.totalfinance.io/docs/totalfinance/mcp

When you preview the site locally with pnpm site:dev, the same endpoint is served at http://127.0.0.1:4173/docs/totalfinance/mcp. A static host without functions serves every page and Markdown twin but not this endpoint; agents can still use LLM-ready docs.

Good prompts

  • "Search the TotalFinance docs for how to price an American put, then write the call."
  • "Read the reference for valueAtRiskReport and explain each option and its default."
  • "Using only exports that get_reference confirms, write a backtest of an RSI rule."
Edit this page on GitHub ↗Every code block on this site is executed in CI against the library.