What if you could simply ask an AI assistant about your stock holdings, open positions, trades and portfolio, instead of logging in and checking everything manually?
That is the idea behind the Jainam MCP Agent.
I have built an open-source project that connects a Jainam ProTrade trading account with AI assistants such as Claude, VS Code and supported ChatGPT setups.
The goal is simple: make it easier for traders and investors to understand their own trading account data using natural language.
You do not need to write SQL queries, create Python scripts for every analysis or manually prepare multiple reports. You can ask questions in simple English and use the AI assistant to help understand the available account information.
GitHub project: https://github.com/malkarisreenivasulu/jainam-mcp-agent
Why did I build Jainam MCP Agent?
Most traders already have access to a lot of information through their broker.
You can see your holdings, positions, orders, trades, funds and historical market data. But getting a useful picture of all this information is not always easy.
For example:
- Which stocks make up most of my portfolio?
- How much have I invested in each stock?
- What is my current unrealised profit or loss?
- Which sectors have the highest allocation?
- Which contracts are present in my current positions?
- How much turnover did I generate in a particular symbol?
- What does my trading activity look like during the day?
You can find some of these answers by opening different sections of your trading platform. But when you want to compare information or prepare a detailed analysis, it can take time.
I wanted to explore a simpler way.
Instead of opening multiple screens and manually preparing reports, why not connect the trading account to an AI assistant and ask questions directly?
That is where MCP comes in.
What is MCP?
MCP stands for Model Context Protocol.
In simple terms, MCP provides a standard way for AI applications to connect with external tools and data sources.
Think of it as a bridge between an AI assistant and another application.
For example, an AI assistant can answer general questions based on its available knowledge. But it cannot automatically see your personal trading account.
An MCP server can provide a controlled connection to that account. The AI assistant can then request specific information through the tools made available by the server.
In this project, the connection looks like this:
Jainam ProTrade API → Jainam MCP Agent → AI Assistant
The MCP Agent acts as the middle layer. It connects to the broker API, retrieves the requested information and makes it available to the AI client.
You can learn more about the protocol here:
https://modelcontextprotocol.io
What is Jainam MCP Agent?
Jainam MCP Agent is a Python-based, read-only MCP server built for Jainam ProTrade.
It uses the Jainam API Python library and the official MCP Python SDK.
Once configured, you can connect it with supported AI applications and ask questions about your own trading account.
For example, you can ask:
- Show my current holdings.
- Summarise my open positions.
- Show my existing orders and trades.
- Find GOLD contracts on MCX.
- Fetch historical candles for a particular token.
- Prepare a sector-wise view of my portfolio.
The AI assistant uses the available MCP tools to retrieve the information and help present it in a more understandable format.
GitHub repository:
https://github.com/malkarisreenivasulu/jainam-mcp-agent
What can you do with Jainam MCP Agent?
Here are some practical examples.
1. View your holdings in a better way
Instead of looking at a long holdings table, you can ask the AI assistant to prepare a portfolio dashboard.
For example:
“Show my total invested capital, current market value and unrealised profit or loss. Also show the top stocks by market value.”
The assistant can help present the information through summary cards, tables and charts, depending on the AI client’s capabilities.
You can also ask for a stock-wise allocation chart.
This makes it easier to understand how your investments are distributed.
2. Analyse your portfolio sector-wise
A stock portfolio may contain companies from banking, IT, automobile, pharmaceuticals, energy and other sectors.
But it is not always easy to understand how much of your total portfolio is allocated to each sector.
You can ask:
“Show my holdings by sector as a donut chart, weighted by current market value.”
This can help answer questions such as:
- Which sector has the highest allocation?
- How much of my portfolio is in banking?
- Is my portfolio concentrated in a few sectors?
- Which stocks contribute most to my portfolio value?
The accuracy of sector analysis depends on the availability of reliable sector classifications. Stocks without a verified classification should be shown separately rather than guessed.
3. Understand your open positions
If you trade in equity derivatives or commodities, you may have several open positions.
You can ask:
“Show my current positions and sort them by unrealised profit and loss.”
You can also request a chart showing positive and negative P&L separately.
For futures and options, contract units and multipliers need to be checked carefully before calculating exposure.
This is important because a chart is only useful when the underlying calculations are correct.
4. Analyse your orders and trades
Trading activity can become difficult to understand when there are many orders and executions.
You can ask the assistant to show:
- Existing orders
- Trade history
- Turnover by symbol
- Number of fills
- Trading activity by hour
For example:
“Show my traded turnover by symbol as a donut chart and the number of fills by hour as a bar chart.”
This can help you understand where most of your trading activity is happening.
One important distinction: turnover is not profit. Orders, fills and completed round trips are also different measurements and should not be mixed.
5. Search for trading contracts
The project can also search the broker’s current contract master.
For example:
“Find GOLD contracts on MCX.”
This can be useful when you need to identify available contracts and their associated tokens.
You can also request historical candles for a particular token, subject to broker API availability.
How does the Jainam MCP Agent work?
The project runs locally on your computer.
You install the Python package, configure your Jainam account session and connect the MCP server to your preferred AI client.
The basic flow is:
- You ask a question in your AI application.
- The AI application identifies the relevant MCP tool.
- The Jainam MCP Agent receives the request.
- It communicates with the Jainam ProTrade API.
- The requested account information is returned to the AI application.
- The AI application explains the result or prepares a chart or report.
The MCP server retrieves the data. The AI application is responsible for interpreting and presenting it.
This separation is important. The project does not claim that every AI client will display the same charts or produce identical results.
Which AI applications can you use?
The repository includes setup guides for different clients.
Claude Desktop
You can connect the local MCP server to Claude Desktop and ask questions about your account.
Guide: See the Claude Desktop setup.
VS Code
Developers can connect the MCP server with supported VS Code AI integrations.
Guide: VS Code setup.
ChatGPT
The repository also includes a separate guide for supported ChatGPT connection setups. This uses a different connection method from the desktop MCP configuration.
Guide: ChatGPT setup.
Please refer to the repository documentation for the latest setup instructions.
How to install Jainam MCP Agent
You need Python 3.11–3.14 and Git.
Open your terminal and run:
git clone --branch v0.1.2 https://github.com/malkarisreenivasulu/jainam-mcp-agent.git
cd jainam-mcp-agent
python3 -m venv .venv
source .venv/bin/activate
python -m pip install .
python -m jainam_mcp configure
python -m jainam_mcp doctor
The configuration process asks for your Jainam user ID and existing user session through hidden terminal prompts.
If you have developer keys but do not have an existing authenticated session, follow the documented browser authorisation process.
You can generate client configuration using:
python -m jainam_mcp client-config claude
For VS Code:
python -m jainam_mcp client-config vscode
Follow the client-specific documentation to complete the connection.
The repository includes separate instructions for macOS, Windows and Linux.
Is it safe? Does it place orders?
This is an important question.
The current Jainam MCP Agent is designed to be read-only.
It does not provide tools for:
- Placing orders
- Modifying orders
- Cancelling orders
- Squaring off positions
- Running autonomous trading strategies
It is designed to retrieve information and support analysis, not to execute trades.
The credentials are kept in your local environment or private credentials file. The repository does not contain the maintainer’s account credentials.
However, there is one important privacy point.
When you ask an AI assistant to analyse your account, the requested account data is sent to the AI client. Depending on the client and its provider, that information may be processed by their services.
So local execution does not automatically mean that all data stays offline.
Use your own account, protect your credentials and review the privacy settings of the AI application you connect.
What do you need before using it?
You need:
- An active Jainam trading account.
- The required ProTrade API access and entitlement.
- A valid authenticated session.
- Python and Git installed on your computer.
- A supported AI application.
API access, rate limits and data availability are controlled by Jainam. Access may not be available to every account.
The current release uses ProTrade Open API v2. It is not an XTS or JLite integration.
What are the current limitations?
I believe it is important to explain what a project can and cannot do.
The current version has some limitations:
- It is read-only.
- It does not place or manage orders.
- It does not provide live streaming or live quotes.
- It does not include a subscription or hosted service.
- It depends on Jainam API access and availability.
- Charts depend on the capabilities of the connected AI client.
- Historical data availability depends on the broker API.
- It is not a financial adviser and does not guarantee the accuracy of market data or investment analysis.
The project also includes validation tests using synthetic broker responses. These tests help check the MCP tools and installation, but they do not prove that every real account, API entitlement or AI client will behave identically.
Why I find this useful
I see MCP as an interesting way to connect financial applications with AI.
Trading platforms already provide a large amount of information. The next step is making that information easier to access and understand.
Imagine being able to ask questions about your holdings, trades and positions in plain English.
Imagine preparing a portfolio report without manually exporting multiple files.
Imagine comparing trading activity across symbols and time periods through a conversation with an AI assistant.
These are practical use cases worth exploring.
I also believe that the future of financial technology will involve more connections between APIs, data platforms and AI applications.
This project is one small step in that direction.
Try Jainam MCP Agent
The project is open source and available on GitHub.
GitHub: https://github.com/malkarisreenivasulu/jainam-mcp-agent
You can review the source code, installation instructions, examples and security information before using it.
If you are a Jainam ProTrade user, developer or someone interested in connecting financial data with AI, I would be interested to hear your feedback.
What would you like to ask your trading account if you could simply use natural language?
Project: Jainam MCP Agent
Developer: Sreenivasulu Malkari
GitHub: https://github.com/malkarisreenivasulu/jainam-mcp-agent
Disclaimer: Jainam MCP Agent is independent community software. It is not an official Jainam product and does not imply endorsement by Jainam. Jainam and ProTrade are trademarks of their respective owners. This project is for technical exploration and account-data analysis, not investment advice.