<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Daniel Fonnegra</title>
    <description>The latest articles on DEV Community by Daniel Fonnegra (@fonnit).</description>
    <link>https://dev.to/fonnit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3855148%2F256e9988-6fea-4867-8584-f5388eb16749.png</url>
      <title>DEV Community: Daniel Fonnegra</title>
      <link>https://dev.to/fonnit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/fonnit"/>
    <language>en</language>
    <item>
      <title>Your Financial Data, Any AI Agent: Building an MCP Server with OpenBB ODP</title>
      <dc:creator>Daniel Fonnegra</dc:creator>
      <pubDate>Wed, 01 Apr 2026 22:48:19 +0000</pubDate>
      <link>https://dev.to/fonnit/your-financial-data-any-ai-agent-building-an-mcp-server-with-openbb-odp-352j</link>
      <guid>https://dev.to/fonnit/your-financial-data-any-ai-agent-building-an-mcp-server-with-openbb-odp-352j</guid>
      <description>&lt;h2&gt;
  
  
  What you'll need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10–3.13&lt;/li&gt;
&lt;li&gt;No API keys for this tutorial (we'll use yfinance + FRED free tier)&lt;/li&gt;
&lt;li&gt;Claude Desktop — or any MCP-compatible client (Cursor, Windsurf, your own agent)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;openbb openbb-yfinance openbb-federal-reserve openbb-fmp openbb-mcp-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;openbb&lt;/code&gt; is the core platform. The provider extensions add data sources — yfinance and Federal Reserve for free data, FMP for richer equity and options coverage (more on that below). &lt;code&gt;openbb-mcp-server&lt;/code&gt; wraps everything as an MCP server.&lt;/p&gt;

&lt;p&gt;After installing, rebuild the static assets ODP uses to discover your extensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openbb-build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This runs once after any install or removal of extensions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Configure FMP (for equity and options data)
&lt;/h2&gt;

&lt;p&gt;yfinance and Federal Reserve are free with no setup. FMP requires a free API key — get one at &lt;a href="https://site.financialmodelingprep.com/developer/docs" rel="noopener noreferrer"&gt;financialmodelingprep.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once you have it, add it to &lt;code&gt;~/.openbb_platform/user_settings.json&lt;/code&gt; (create the file if it doesn't exist):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"credentials"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"fmp_api_key"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"YOUR_FMP_API_KEY"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, set it as an environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;FMP_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;YOUR_FMP_API_KEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3: Verify the data layer
&lt;/h2&gt;

&lt;p&gt;Before touching MCP, confirm data is working:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openbb&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;obb&lt;/span&gt;

&lt;span class="c1"&gt;# Treasury yield curve via Federal Reserve
&lt;/span&gt;&lt;span class="n"&gt;rates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;obb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;fixedincome&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;government&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;treasury_rates&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;provider&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;federal_reserve&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;rates&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_df&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see a table of yield rates across maturities. The breadth is the point: equity, fixed income, macro, options, ETF flows, FRED, IMF — all one standardized interface.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4: Start the MCP server
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openbb-mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By default this starts on &lt;code&gt;streamable-http&lt;/code&gt; transport at &lt;code&gt;http://127.0.0.1:8001&lt;/code&gt;. Every ODP endpoint you have installed is immediately available as an MCP tool — no manual tool definitions required.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What about remote use?&lt;/strong&gt; If you want to run the server on a VPS and have agents connect over the network, bind it to all interfaces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openbb-mcp &lt;span class="nt"&gt;--host&lt;/span&gt; 0.0.0.0 &lt;span class="nt"&gt;--port&lt;/span&gt; 8080
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your agent then connects to &lt;code&gt;http://your-server:8080/mcp/&lt;/code&gt; instead of localhost. Useful when multiple agents share the same ODP server, or you want a persistent endpoint running independently of your local machine.&lt;/p&gt;

&lt;p&gt;You can also restrict which data categories are exposed — handy when you want to keep the toolset focused:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;openbb-mcp &lt;span class="nt"&gt;--default-categories&lt;/span&gt; equity,fixedincome,economy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Step 5: Connect your client
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Claude Desktop
&lt;/h3&gt;

&lt;p&gt;Add to your config file:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;macOS:&lt;/strong&gt; &lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;code&gt;%APPDATA%\Claude\claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"openbb-mcp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"uvx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"--from"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openbb-mcp-server"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"--with"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openbb"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"openbb-mcp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"--transport"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"stdio"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Needs &lt;code&gt;uvx&lt;/code&gt; (&lt;code&gt;pip install uv&lt;/code&gt;). Restart Claude Desktop — tools appear in the hammer panel.&lt;/p&gt;




&lt;h3&gt;
  
  
  Claude Code
&lt;/h3&gt;

&lt;p&gt;Run the server first, then register it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http openbb-mcp http://localhost:8001/mcp/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify with &lt;code&gt;/mcp&lt;/code&gt; inside Claude Code. To make it available across all your projects:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http &lt;span class="nt"&gt;--scope&lt;/span&gt; user openbb-mcp http://localhost:8001/mcp/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Codex
&lt;/h3&gt;

&lt;p&gt;Add to &lt;code&gt;.mcp.json&lt;/code&gt; at your repo root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"openbb-mcp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"http://localhost:8001/mcp/"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Codex picks it up automatically on next launch.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6: Ask it something that actually requires this
&lt;/h2&gt;

&lt;p&gt;Here are prompts worth running:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Multi-asset macro question:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Compare the 2-year and 10-year treasury yields over the last 6 months. Is the curve still inverted? What does the current spread look like?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Sector rotation:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Pull the last 30 days of price history for SPY, XLK, XLF, XLE, XLV, and XLI. Which sectors are outperforming the index and which are lagging?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Commodity positioning:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Get the latest CFTC Commitment of Traders report for gold. Are the commercials net short or net long? What does that historically signal?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Cross-asset correlation:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Get gold spot prices and the DXY (USD index) for the last year. Do they move inversely the way they're supposed to?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Claude will call the relevant OpenBB MCP tools, fetch real data, and reason over it — not hallucinate numbers, not give you stale training data, but pull from live market sources at the time you ask.&lt;/p&gt;

&lt;p&gt;That's the difference. Not "what's Apple's price" — anyone can Google that. It's "help me think through this using real data across multiple sources at once."&lt;/p&gt;




&lt;h2&gt;
  
  
  Where to go from here
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Add more providers.&lt;/strong&gt; yfinance is just the start. ODP has extensions for Alpha Vantage, Polygon, FRED, the Bureau of Labor Statistics, IMF, and more. Install any of them and they're immediately exposed through the same MCP server — no code changes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wire in your own data.&lt;/strong&gt; ODP's extension system lets you wrap any internal API or proprietary dataset as a provider. If your data can be described as three methods — transform query, fetch data, transform response — it becomes an MCP-accessible tool in one &lt;code&gt;pip install&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy for your agents.&lt;/strong&gt; Run &lt;code&gt;openbb-mcp --host 0.0.0.0&lt;/code&gt; on a server, point your autonomous agents at &lt;code&gt;http://your-server:8001/mcp/&lt;/code&gt;, and they have a persistent, queryable financial data layer available on demand — without you babysitting a local process.&lt;/p&gt;




&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;The real value of MCP isn't "I can ask Claude what Tesla closed at." It's giving AI agents structured, real-time access to financial data complex enough that the answer actually requires reasoning — across instruments, timeframes, and data sources at once.&lt;/p&gt;

&lt;p&gt;ODP is the cleanest path to that. Install, build, run. Everything else follows.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;At FonnIT we build production tools with exactly this kind of stack. If you're thinking about what a custom financial data pipeline or AI research tool could look like for your team — &lt;a href="https://www.fonnit.com/contact?utm_source=devto&amp;amp;utm_medium=blog&amp;amp;utm_campaign=weekly-article&amp;amp;utm_content=openbb-odp-mcp-server" rel="noopener noreferrer"&gt;let's talk&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>finance</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
