Fyers Mcp Server
About
A comprehensive MCP server that enables Claude Desktop to interact with Fyers trading platform through a secure, automated authentication flow. Supports all major trading operations including portfolio management, order placement, and real-time market data.
Details
- Author
- quantabox
- Downloads
- 400
- Categories
- Developer Tools, Finance, Other, API
Jump to
- Place market, limit, stop, and stop-limit orders
- Modify or cancel existing orders
- View account funds, holdings, and current positions
- Fetch live quotes for multiple symbols
- Supports margin, CNC, intraday, bracket, and cover orders
- Order validity options: DAY, IOC, GTD
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Fyers Mcp ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Install dependencies with uv sync or pip install ., then copy .env.example to .env and fill in your Fyers API credentials. Add the server to your Claude Desktop configuration file (claude_desktop_config.json) with the appropriate command and path. Restart Claude Desktop, type authenticate to log in via the browser, then use the exposed tools for trading, portfolio management, and market data.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"fyers mcp server": {
"fyers-mcp-server": {
"command": "uv",
"args": [
"run",
"--directory",
"<path to the repo>/fyers-mcp-server",
"python",
"fyers_mcp_complete.py"
],
"env": {
"PATH": "<path to any uv path, this is optional>",
"PYTHONWARNINGS": "ignore"
}
}
}
}
}
McpServers
{
"fyers-mcp-server": {
"command": "uv",
"args": [
"run",
"--directory",
"<path to the repo>/fyers-mcp-server",
"python",
"fyers_mcp_complete.py"
],
"env": {
"PATH": "<path to any uv path, this is optional>",
"PYTHONWARNINGS": "ignore"
}
}
}
An MCP server for the Fyers API v3, featuring automated OAuth authentication.
MCP (Model Context Protocol) server for Fyers API v3 with automated OAuth authentication
A comprehensive MCP server that enables Claude Desktop to interact with Fyers trading platform through a secure, automated authentication flow. Supports all major trading operations including portfolio management, order placement, and real-time market data.
- One-click OAuth flowwith automatic browser handling
- Persistent token storagein.envfile
- Auto-refreshcapabilities with session management
- Portfolio Management: Holdings, positions, funds, profile
- Order Management: Place, modify, cancel orders
- Market Data: Real-time quotes for multiple symbols
- Order History: Complete order and trade book
- Full error handlingwith detailed error messages
- Type safetywith parameter validation
- Comprehensive loggingfor debugging
- Claude Desktop integrationwith simple configuration
- Python 3.10 or higher
- Claude Desktopinstalled
- Fyers Trading Accountwith API access
# Clone the repository git clone https://github.com/quantabox/fyers-mcp-server.git cd fyers-mcp-server # Install dependencies using uv (recommended) curl -LsSf https://astral.sh/uv/install.sh | sh uv sync # Or install with pip pip install .
FYERS_CLIENT_ID=YOUR_APP_ID-100 # e.g., ABC123XYZ-100 FYERS_SECRET_KEY=YOUR_SECRET_KEY # Secret from Fyers app FYERS_REDIRECT_URI=http://localhost:8080/
Add to your Claude Desktop configuration file:
macOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%\Claude\claude_desktop_config.json
{ "mcpServers": { "fyers-mcp-server": { "command": "uv", "args": [ "run", "--directory", "/path/to/fyers-mcp-server", "python", "fyers_mcp_complete.py" ], "env": { "PYTHONWARNINGS": "ignore" } } } }
- Restart Claude Desktop
- Authenticate: In Claude, type:authenticate
- Browser will open→ Login to Fyers → Automatic token capture
- Start trading: All 11 tools are now available!
- authenticate()- One-click OAuth authentication
- check_auth_status()- Verify current authentication
- get_profile()- User profile information
- get_funds()- Account balance and margin details
- get_holdings()- Portfolio holdings with P&L
- get_positions()- Current trading positions
- place_order(symbol, quantity, order_type, side, ...)- Place new orders
- modify_order(order_id, quantity, limit_price, ...)- Modify existing orders
- cancel_order(order_id)- Cancel pending orders
- get_orders()- Order history and status
- get_quotes(symbols)- Real-time quotes for multiple symbols
# Check account balance get_funds() # View all holdings with P&L get_holdings() # Check current positions get_positions()
# Place a market order place_order("NSE:SBIN-EQ", 10, "MARKET", "BUY") # Place a limit order place_order("NSE:RELIANCE-EQ", 5, "LIMIT", "BUY", limit_price=2500) # Modify an order modify_order("ORDER_ID", quantity=15, limit_price=2550) # Cancel an order cancel_order("ORDER_ID")
# Get live quotes get_quotes("NSE:SBIN-EQ,NSE:RELIANCE-EQ,NSE:TCS-EQ")
- MARKET- Market order (immediate execution)
- LIMIT- Limit order (execute at specific price)
- STOP- Stop loss order
- STOPLIMIT- Stop limit order
- MARGIN- Margin trading (intraday with leverage)
- CNC- Cash and Carry (delivery)
- INTRADAY- Intraday trading
- BO- Bracket Order
- CO- Cover Order
- DAY- Valid for current trading day
- IOC- Immediate or Cancel
- GTD- Good Till Date
# Check credentials in .env file cat .env | grep FYERS # Verify app configuration at https://myapi.fyers.in/dashboard/
# Test MCP server directly cd /path/to/fyers-mcp-server uv run python fyers_mcp_complete.py # Check Claude Desktop logs (macOS) tail -f ~/Library/Logs/Claude/mcp.log
- Verify symbol format:NSE:SYMBOL-EQfor equity
- Check market hours (9:15 AM - 3:30 PM IST)
- Ensure sufficient funds/margin
export LOG_LEVEL=DEBUG uv run python fyers_mcp_complete.py
fyers-mcp-server/ ├── fyers_mcp_complete.py # Main MCP server ├── pyproject.toml # Dependencies ├── .env.example # Environment template ├── claude_config.json # Claude Desktop config └── README.md # This file
- Fork the repository
- Create feature branch:git checkout -b feature/new-tool
- Add MCP tool: Use@mcp.tool()decorator
- Test with Claude Desktop
- Submit pull request
# Install development dependencies uv sync --dev # Run tests uv run pytest # Type checking uv run mypy fyers_mcp_complete.py
graph TD A[Claude: authenticate] --> B[Generate Auth URL] B --> C[Open Browser] C --> D[User Login] D --> E[Auth Code Capture] E --> F[Exchange for Token] F --> G[Store in .env] G --> H[Ready for Trading]
All functions return standardized responses:
- ✅Success: Clear confirmation with relevant data
- ❌Error: Detailed error message with troubleshooting hints
We welcome contributions! Please see ourContributing Guidelinesfor details.
- WebSocket real-time data streaming
- Advanced order types (OCO, Iceberg)
- Portfolio analytics and reporting
- Options chain analysis tools
- Risk management features
This project is licensed under the MIT License - see theLICENSEfile for details.
This software is for educational and development purposes. Trading involves financial risk. Users are responsible for their trading decisions and should thoroughly test in demo environments before live trading.
- Fyers API Documentation
- MCP Protocol Specification
- Claude Desktop
- Issues & Support
- Current Version: 1.0.0
- API Compatibility: Fyers API v3.1.7
- Python Support: 3.10+
- Tools Available: 11/11 ✅
- Production Ready: Yes ✅
Made with ❤️ for the trading community
Enable algorithmic trading with Claude's intelligence
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Interact with over 100 cryptocurrency exchange APIs using the CCXT library.
An MCP server and OpenAI function calling service for interacting with the Deriv API.
An MCP server for the Zerodha Kite Connect API, featuring fully automated authentication without manual token handling.
Integrate with the MetaTrader 4 trading platform to access trading functions and data via an HTTP bridge and Expert Advisor.
Hosted, Stateless & Multitenant Kite MCP server enables AI assistants to access market data, manage portfolios, and execute trading operations through Zerodha Kite.
Access prediction market data from the PolyMarket API.
A server for local interactions with the QuantConnect API.
A demo MCP server that provides rude responses to stock queries.
An MCP server for interacting with the Trading Simulator API to simulate trading activities.
The Capital.com MCP Server lets your AI assistant talk to your trading account directly. Market data, position checks, trade previews – all in plain language, without leaving your AI tool.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





