shoonya-mcp

shoonya-mcp

Enables algorithmic trading on the Shoonya platform through natural language commands, with military-grade encryption for credential security.

Category
Visit Server

README

Shoonya MCP Server (Node.js)

A lightweight, bank-level secure Model Context Protocol (MCP) server for algorithmic trading via the Shoonya Broker API.

This package is designed for effortless and secure distribution. It runs natively over stdio, meaning it can be plugged directly into AI assistants like Claude Desktop, Cursor, or Gemini without requiring a Python environment.

šŸ” Security Architecture

Your trading credentials are protected using military-grade encryption. The AI assistant never sees, stores, or transmits your passwords.

How It Works

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│                   YOUR LOCAL MACHINE                    │
│                                                         │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    Master     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”    │
│  │  AI (Claude,  │   Password   │  Shoonya MCP     │    │
│  │  Cursor, etc) │ ──────────►  │  Server (Node.js)│    │
│  │               │              │                  │    │
│  │  Never sees   │              │  Decrypts vault  │    │
│  │  credentials  │              │  locally only    │    │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜              ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜    │
│                                         │               │
│                                         ā–¼               │
│                              ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”       │
│                              │  ~/.shoonya-mcp/  │       │
│                              │  vault.enc        │       │
│                              │                   │       │
│                              │  AES-256-GCM      │       │
│                              │  encrypted file   │       │
│                              ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜       │
│                                         │               │
│                                         ā–¼               │
│                              ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”       │
│                              │  Shoonya Broker   │       │
│                              │  API (HTTPS)      │       │
│                              ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜       │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Encryption Details

Feature Specification
Encryption Algorithm AES-256-GCM (used by banks, governments, military)
Key Derivation PBKDF2 with SHA-256, 310,000 iterations (OWASP 2023)
Salt 32 bytes, cryptographically random, unique per vault
IV (Nonce) 16 bytes, cryptographically random, unique per save
Authentication GCM auth tag prevents tampering
File Permissions 0600 (owner read/write only, Unix systems)
Vault Location ~/.shoonya-mcp/vault.enc (never in your project)
AI Exposure āŒ Credentials never sent to or seen by the AI

What the AI Can See vs Cannot See

Data AI Can See?
Master Password āœ… Only to decrypt vault (not stored)
User ID āŒ Never
Broker Password āŒ Never
TOTP Secret Key āŒ Never
API Key āŒ Never
Vendor Code āŒ Never
IMEI āŒ Never
Order commands āœ… (e.g., "NIFTY 24500 CE 30")
Order results āœ… (order ID, margin, status)

Quick Start

Step 1: Setup Credentials (One-Time)

Run the interactive setup wizard in your terminal:

npx github:benatcmathew/Shoonya_Trading_MCP-Server --setup

This will:

  • Ask for your Shoonya broker credentials
  • Ask you to set a master password
  • Encrypt everything with AES-256-GCM and save to ~/.shoonya-mcp/vault.enc

Editing Credentials (90-Day Password Reset)

Shoonya requires users to reset their broker password every 90 days. To update your vault with your new password (or edit any other API details), simply run the edit command:

npx github:benatcmathew/Shoonya_Trading_MCP-Server --edit

When prompted, type yes to overwrite your existing vault, and enter your new details.

Step 2: Connect to Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "shoonya-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "github:benatcmathew/Shoonya_Trading_MCP-Server"
      ]
    }
  }
}

Step 3: Start Trading!

In Claude Desktop, simply say:

"Login to Shoonya" → The AI will ask for your master password only. "Buy NIFTY 24500 CE 30" → Places a market order. "Place auto SL for order 12345 on NIFTY" → Auto stop-loss.

CLI Commands

Command Description
npx shoonya-mcp-server --setup First-time credential setup (interactive wizard)
npx shoonya-mcp-server --edit Edit/update stored credentials
npx shoonya-mcp-server --delete Securely wipe and delete the vault
npx shoonya-mcp-server --status Check if a vault exists
npx shoonya-mcp-server Start the MCP server (default, used by Claude)

Available MCP Tools

Tool Parameters Description
login master_password Decrypt vault & login to Shoonya
place_order buy_or_sell, command Smart order (e.g., "NIFTY 24500 CE 30 L 110")
place_manual_sl command Manual SL (e.g., "NIFTY 24500 CE 30 SL 100")
place_auto_sl order_id, index Auto SL from filled order
modify_order order_id, exchange, tradingsymbol, ... Modify open order
modify_sl order_id, exchange, tradingsymbol, ... Modify SL order
cancel_order order_id Cancel any order
exit_order order_id, product_type Exit position
get_order_book — Fetch order book
check_margin — Fetch available margin
check_order_status order_id Check specific order status

Manual Build from Source

git clone https://github.com/benatcmathew/Shoonya_Trading_MCP-Server.git
cd Shoonya_Trading_MCP-Server
npm install
npm run build
npm start

License

ISC

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured