
shoonya mcp server
一个模拟 Shoonya 交易 API 的市场连接协议(MCP)服务器,用于测试客户端应用。
Repository Info
About This Server
一个模拟 Shoonya 交易 API 的市场连接协议(MCP)服务器,用于测试客户端应用。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Shoonya MCP Server (Mock)
Description
This project is a mock Market Connectivity Protocol (MCP) server designed to simulate interactions with a Shoonya-like trading API. It provides a basic framework for testing client applications that would connect to Shoonya for order placement and market data.
Note: This is a mock server. All interactions with the "Shoonya API" are simulated through placeholder functions. No actual trading or connection to live Shoonya systems occurs.
Key Features
- Authentication:
/connectendpoint for client authentication.- Simulates Shoonya login and returns an MCP-specific session token.
- Order Management:
/orderendpoint for placing trading orders.- Comprehensive validation of order parameters (data types, allowed values for exchange, order type, etc.).
- Basic pre-trade risk checks (maximum order quantity, maximum order value for LIMIT/SL orders).
- Returns mock responses from the "broker," including order status.
- Market Data (Mock):
/marketdata/subscribeendpoint to simulate subscribing to instrument data./marketdata/fetchendpoint to retrieve mock market data for subscribed instruments.- Simulated data includes LTP, volume, OHLC, and changes randomly on fetch to mimic a live feed.
- API Definition:
- A detailed API definition is available in
mcp_server_api_definition.md.
- A detailed API definition is available in
Setup and Running
-
Prerequisites:
- Python 3.x
- pip (Python package installer)
-
Installation:
- Clone the repository (if you haven't already).
- Navigate to the project directory.
- Install the required dependencies:
pip install -r requirements.txt
-
Running the Server:
- To start the Flask development server:
python mcp_server/app.py - The server will typically start on
http://127.0.0.1:5000/.
- To start the Flask development server:
API Endpoints Overview
POST /connect: Authenticate and get a session token.POST /order: Place a new order. Requires Bearer token.POST /marketdata/subscribe: Subscribe to mock market data. Requires Bearer token.GET /marketdata/fetch: Fetch mock market data for subscriptions. Requires Bearer token.
Refer to mcp_server_api_definition.md for detailed request/response formats.
Current Status
- The server is a mock implementation intended for development and testing of client applications.
- All interactions that would normally go to the Shoonya trading platform are handled by placeholder functions within
mcp_server/app.py. - No real financial transactions occur.
- Further development would be required to integrate with the actual Shoonya API.
Quick Start
Clone the repository
git clone https://github.com/onlyzerosonce/shoonya-mcp-serverInstall dependencies
cd shoonya-mcp-server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.