okama-mcp — Claude Code MCP server: what it does, how to install
Connects the okama investment library to AI coding assistants for portfolio backtesting, Monte Carlo simulations, and efficient frontier charts.
MIT ★ 5 updated 2026-10-21
claude mcp add okama-mcp -- uvx okama-mcpWhat okama-mcp does
This server connects the okama toolkit and okama Planner directly to your AI client. It allows the assistant to search asset registries, evaluate historical returns, and model retirement scenarios. You do not need to write Python. The model handles calculations through direct tool calls.
Built on FastMCP, the project runs over local stdio or a streaming HTTP server. Financial computations stay stateless, meaning each request supplies the full asset structure. The server hashes inputs to cache heavy calculations like Portfolio or EfficientFrontier. It also accepts nested portfolios, treating an entire basket of securities as a single sub-asset.
Running the server requires Python 3.11 or newer. Excel reports and client registry tools stay disabled on remote HTTP endpoints, so you must run local stdio if you need spreadsheet exports.
What it helps with
- run backtests on custom portfolio allocations against historical data
- generate Monte Carlo retirement simulations with inflation adjustments
- compute the efficient frontier for multiple assets and risk-free rates
- search securities by ticker, name, or ISIN code
Example prompts for the agent
- Find the tangency portfolio for SPY, BND, and GLD assuming a 3% risk-free rate.
- Run a Monte Carlo forecast withdrawing 1,000 dollars monthly adjusted for inflation over 25 years.
How to install okama-mcp
Platform CLI
claude mcp add okama-mcp -- uvx okama-mcpuvx runs the command named after the package; if the README names another one, use uvx --from okama-mcp <command>
Platform CLI
codex mcp add okama-mcp -- uvx okama-mcpuvx runs the command named after the package; if the README names another one, use uvx --from okama-mcp <command>
Config file
{
"mcpServers": {
"okama-mcp": {
"command": "uvx",
"args": [
"okama-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from okama-mcp <command>
Config file
{
"servers": {
"okama-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"okama-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from okama-mcp <command>
Platform CLI
gemini mcp add okama-mcp uvx okama-mcpuvx runs the command named after the package; if the README names another one, use uvx --from okama-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about okama-mcp
How to install okama-mcp in Claude Code?
Run claude mcp add okama-mcp -- uvx okama-mcp in your terminal.
What does okama-mcp do?
It exposes okama financial analytics tools to your LLM. The assistant can evaluate asset performance, run retirement projections, and build portfolio frontier plots.
What are the limitations of the HTTP transport?
Remote HTTP connections handle core math and portfolio planning. Exporting reports to Excel and accessing client registry features require a local stdio setup.