onlyzerosonce
MCP Serveronlyzerosoncepublic

shoonya mcp server

一个模拟 Shoonya 交易 API 的市场连接协议(MCP)服务器,用于测试客户端应用。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

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:
    • /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.

Quick Start

1

Clone the repository

git clone https://github.com/onlyzerosonce/shoonya-mcp-server
2

Install dependencies

cd shoonya-mcp-server
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Owneronlyzerosonce
Reposhoonya-mcp-server
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation