Skip to content

Crafting a Financial Analyst using MCP (Master Chief Programming) Technology

Unravel the foreseeable realm of finance analysis utilizing an MCP-driven financial analyst, capable of transforming queries into practical stock recommendations.

Creating a Financial Analyst Using MCP Technology
Creating a Financial Analyst Using MCP Technology

Crafting a Financial Analyst using MCP (Master Chief Programming) Technology

Microsoft's latest project, the MCP-supported financial analyst solution, is setting a new benchmark for user-focused financial analytics. This groundbreaking solution showcases how AI agents can handle complex workflows, demonstrating the potential of multi-agent systems in transforming financial analysis.

At the heart of this project are two main components: The Financial Analyst Crew and the MCP Server File. The Financial Analyst Crew, backed by CrewAI agents, reads the user query, creates Python code, and runs it to visualize stock data in real time. On the other hand, the MCP Server File, named as "financial-analyst", houses several tools that make this seamless interaction possible.

The project begins with Tool 1 in the MCP Server File, . This tool takes a natural language query and returns a Python script as a string. The Query Parser, one of the three agents created for this project, reads the query, extracts stock tickers, timeframes, and intended actions, and turns natural language into structured JSON.

Next, the Pydantic model ensures structured extraction from the user’s query. The Code Writer, another agent, takes the structured query output and writes clean, executable Python code using yfinance, pandas, and matplotlib.

In Step 4, the sequence for using the agents is: Parser query, Write Python Code, Execute & verify results. The Code Executor, the third agent, runs the generated code, fixes errors if something breaks, and can delegate back to the Code Writer for fixes. Tool 2 in the MCP Server File, , saves the generated Python code into a file named .

The culmination of these steps is the creation of the MCP Server File in Step 5. The main function in the MCP Server File runs the MCP server locally over stdio, ready to integrate into any AI platform that supports MCP.

The system uses a user query, an MCP agent, and a set of specialized agents (Financial Analyst Crew) to deliver real-time, context-aware stock insights. Typing a query like "Plot Apple's stock performance for the last 6 months" produces a ready-to-use chart without requiring any manual coding.

For those interested in learning the basics of MCP, a free course is available: Foundations of Model Context Protocol. This project demonstrates how multi-agent systems can transform financial analysis by combining structured query parsing, automated Python code generation, and real-time execution.

Soumil Jain, a Data Science Trainee at the website, is working on the development of advanced AI solutions like this one. The MCP-supported financial analyst solution is a testament to the potential of AI in streamlining complex financial analytics, setting a new standard for user-focused financial analytics.

Read also: