Shoonya MCP Server (Mock)

by onlyzerosonce

337 downloads
Not rated
GitHub

Description

# 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…

About

# 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…

Details

Author
onlyzerosonce
Downloads
337
Categories
Other

- /connect endpoint for simulated Shoonya authentication and session token generation.
- /order endpoint with comprehensive order parameter validation and pre‑trade risk checks.
- /marketdata/subscribe and /marketdata/fetch endpoints for simulated market data (LTP, volume, OHLC).
- Mock responses from the “broker,” including order status.
- Returns an MCP‑specific session token after simulated login.

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:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Shoonya MCP Server (Mock)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install Python 3.x and pip, clone the repository, then run pip install -r requirements.txt. Start the server with python mcp_server/app.py; it typically runs on http://127.0.0.1:5000/. Use the provided endpoints (/connect, /order, /marketdata/subscribe, /marketdata/fetch) to simulate authentication, order placement, and market data retrieval.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "shoonya mcp server (mock)": {
            "shoonya-mcp-server": {
                "command": "python",
                "args": [
                    "mcp_server/app.py"
                ]
            }
        }
    }
}

McpServers

{
    "shoonya-mcp-server": {
        "command": "python",
        "args": [
            "mcp_server/app.py"
        ]
    }
}

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:
/connect endpoint for client authentication.
Simulates Shoonya login and returns an MCP-specific session token.
Order Management:
/order endpoint 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/subscribe endpoint to simulate subscribing to instrument data.
/marketdata/fetch endpoint 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.

Setup and Running

1. Prerequisites:
Python 3.x
pip (Python package installer)

2. Installation:
Clone the repository (if you haven't already).
Navigate to the project directory.
Install the required dependencies:

        pip install -r requirements.txt

3. 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/.

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.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.