Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - epiFi/fi-mcp-dev: A version of Fi MCP for development · GitHub
Skip to content

Repository files navigation

fi-mcp-dev

A minimal, hackathon-ready version of the Fi MCP server. This project provides a lightweight mock server for use in hackathons, demos, and development, simulating the core features of the production Fi MCP server with dummy data and simplified authentication.

Purpose

  • fi-mcp-dev is designed for hackathon participants and developers who want to experiment with the Fi MCP API without accessing real user data or production systems.
  • It serves dummy financial data and uses a dummy authentication flow, making it safe and easy to use in non-production environments.

Features

  • Simulates Fi MCP API: Implements endpoints for net worth, credit report, EPF details, mutual fund transactions, and bank transactions.
  • Dummy Data: All responses are served from static JSON files in test_data_dir/, representing various user scenarios.
  • Dummy Authentication: Simple login flow using allowed phone numbers (directory names in test_data_dir/). No real OTP or user verification.
  • Hackathon-Ready: No real integrations, no sensitive data, and easy to reset or extend.

Directory Structure

  • main.go — Entrypoint, sets up the server and endpoints.
  • middlewares/auth.go — Implements dummy authentication and session management.
  • test_data_dir/ — Contains directories named after allowed phone numbers. Each directory holds JSON files for different API responses (e.g., fetch_net_worth.json).
  • static/ — HTML files for the login and login-successful pages.

Dummy Data Scenarios

The dummy data covers a variety of user states. Example scenarios:

  • All assets connected: Banks, EPF, Indian stocks, US stocks, credit report, large or small mutual fund portfolios.
  • All assets except bank account: No bank account, but other assets present.
  • Multiple banks and UANs: Multiple bank accounts and EPF UANs, partial transaction coverage.
  • No assets connected: Only a savings account balance is present.
  • No credit report: All assets except credit report.

Test Data Scenarios

Phone NumberDescription
1111111111No assets connected. Only saving account balance present
2222222222All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Large mutual fund portfolio with 9 funds
3333333333All assets connected (Banks account, EPF, Indian stocks, US stocks, Credit report). Small mutual fund portfolio with only 1 fund
4444444444All assets connected (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 2 UAN account connected . With 3 different bank with multiple account in them . Only have transactions for 2 bank accounts
5555555555All assets connected except credit score (Banks account, EPF, Indian stocks, US stocks). Small mutual fund portfolio with only 1 fund. With 3 different bank with multiple account in them. Only have transactions for 2 bank accounts
6666666666All assets connected except bank account (EPF, Indian stocks, US stocks). Large mutual fund portfolio with 9 funds. No bank account connected
7777777777Debt-Heavy Low Performer. A user with mostly underperforming mutual funds, high liabilities (credit card & personal loans). Poor MF returns (XIRR < 5%). No diversification (all equity, few funds). Credit score < 650. High credit card usage, multiple loans. Negligible net worth or negative.
8888888888SIP Samurai. Consistently invests every month in multiple mutual funds via SIP. 3–5 active SIPs in MFs. Moderate returns (XIRR 8–12%).
9999999999Fixed Income Fanatic. Strong preference for low-risk investments like debt mutual funds and fixed deposits. 80% of investments in debt MFs. Occasional gold ETF (Optional). Consistent but slow net worth growth (XIRR ~ 8-10%).
1010101010Precious Metal Believer. High allocation to gold and fixed deposits, minimal equity exposure. Gold MFs/ETFs ~50% of investment. Conservative SIPs in gold funds. FDs and recurring deposits. Minimal equity exposure.
1212121212Dormant EPF Earner. Has EPF account but employer stopped contributing; balance stagnant. EPF balance > ₹2 lakh. Interest not being credited. No private investment.
1414141414Salary Sinkhole. User’s salary is mostly consumed by EMIs and credit card bills. Salary credit every month. 70% goes to EMIs and credit card dues. Low or zero investment. Credit score ~600–650.
1313131313Balanced Growth Tracker. Well-diversified portfolio with EPF, MFs, stocks, and some US exposure. High EPF contribution. SIPs in equity & hybrid MFs. International MFs/ETFs 10–20%. Healthy net worth growth. Good credit score (750+).
2020202020Starter Saver. Recently started investing, low ticket sizes, few transactions. Just 1–2 MFs, started < 6 months ago. SIP ₹500–₹1000. Minimal bank balance, no debt.
2121212121Dual Income Dynamo. Has freelance + salary income; cash flow is uneven but investing steadily. Salary + multiple credits from UPI apps. MF investments irregular but increasing. High liquidity in bank accounts. Credit score above 700. Occasional business loans or overdraft.
2525252525Live-for-Today. High income but spends it all. Investments are negligible or erratic. Salary > ₹2L/month. High food, shopping, travel spends. No SIPs, maybe one-time MF buy. Credit card dues often roll over. Credit score < 700, low or zero net worth.

Example: Dummy Data File

A sample fetch_net_worth.json (truncated for brevity):

{
"netWorthResponse": {
"assetValues": [
{"netWorthAttribute": "ASSET_TYPE_MUTUAL_FUND", "value": {"currencyCode": "INR", "units": "84642"}},
{"netWorthAttribute": "ASSET_TYPE_EPF", "value": {"currencyCode": "INR", "units": "211111"}}
],
"liabilityValues": [
{"netWorthAttribute": "LIABILITY_TYPE_VEHICLE_LOAN", "value": {"currencyCode": "INR", "units": "5000"}}
],
"totalNetWorthValue": {"currencyCode": "INR", "units": "658305"}
}
}

Authentication Flow

  • When a tool/API is called, the server checks for a valid session.
  • If not authenticated, the user is prompted to log in via a web page (/mockWebPage?sessionId=...).
  • Enter any allowed phone number (see directories in test_data_dir/). OTP is not validated.
  • On successful login, the session is stored in memory for the duration of the server run.

Running the Server

Prerequisites

Install dependencies

go mod tidy

Start the server

FI_MCP_PORT=8080 go run .

The server will start on http://localhost:8080.

Usage

  • Follow instructions in this guide to setup client
  • Replace url with locally running server, for example: http://localhost:8080/mcp/stream
  • When prompted for login, use one of the above phone numbers
  • Otp/Passcode can be anything on the webpage

Simple curl client

curl -X POST -H "Content-Type: application/json" -H "Mcp-Session-Id: mcp-session-594e48ea-fea1-40ef-8c52-7552dd9272af" -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"fetch_bank_transactions","arguments":{}}}' http://localhost:8080/mcp/stream

If you run it once you will get login_url in response, running it again after login will give you the data

Simple fastmcp python client

frommcp.client.streamable_httpimportstreamablehttp_clientfrommcp.client.sessionimportClientSessionimportasyncioasyncdefmain():
try:
asyncwithstreamablehttp_client("http://localhost:8080/mcp/stream") as (
read_stream,
write_stream,
_,
):
asyncwithClientSession(
read_stream,
write_stream,
) assession:
awaitsession.initialize()
tools=awaitsession.list_tools()
print(tools)
exceptExceptionase:
print(f"error: {e}")
if__name__=="__main__":
asyncio.run(main())

Requirements:

  • fastmcp (pip install mcp)

Simple google adk example

fromgoogle.adk.agents.llm_agentimportLlmAgentfromgoogle.adk.tools.mcp_tool.mcp_toolsetimportMCPToolset, StreamableHTTPConnectionParamstoolset=MCPToolset(
connection_params=StreamableHTTPConnectionParams(
url="http://localhost:8080/mcp/stream"
)
)
root_agent=LlmAgent(
model='gemini-2.0-flash',
name='fi_mcp',
instruction="You are an agent proficient in financial advises",
tools=[toolset],
)

Requirements:

  • google-adk(>=1.8.0) (pip install google-adk)
  • export GOOGLE_API_KEY=YOUR_API_KEY
  • Run adk web in parent directory

If you are using skip_auth branch you should directly get data as shown Screenshot 2025-07-27 at 03 57 08

FAQ

  • Why do I need to login everytime in ADKs?

    A session in MCP is one to one connection between MCP server and MCP client and needs login once. If your ADK have multiple agents and you are creating multiple clients for them make sure you maintain a common sessionId and pass that around. But in case you want to skip auth entirely, although not recommeneded because we want your agents to work on production usecases, you can refer to this issue on how to skip auth

  • Why am I getting invalid session id?

    If you are creating custom session id before client initialization then make sure you prefix it with mcp-session-. For example: 3ef38b37-323a-4bbd-acbb-3fe02f97783f is not valid and mcp-session-3ef38b37-323a-4bbd-acbb-3fe02f97783f is valid

About

A version of Fi MCP for development

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages