Skip to main content
Glama
biranjan01
by biranjan01

Vikalp

Open-source options lab for Indian markets — with an AI agent built in.

option chains · greeks · strategy payoff · max pain · position analyzer · MCP server

CI License: MIT Python MCP

Vikalp (विकल्प, "option") is a free, open-source alternative to Sensibull / Opstra for NSE & BSE options — usable from the terminal, from Python, or directly inside your AI coding agent (Claude Code, OpenCode, Cursor, Gemini CLI, any MCP client).

You:  "Analyze my CANBK 121 CE position — should I hold above VWAP?"
AI:   (calls vikalp MCP tools → chain, OI, greeks, payoff)
      "Hold while spot > 121.70, exit below 121.00. Breakeven 123.78 needs +1.6%..."

Why

Every serious options tool in India — Sensibull, Opstra, Quantsapp, AlgoTest — is a paid walled garden. Meanwhile AI agents can't touch market data at all. Vikalp fixes both:

  • 100% open source (MIT) — no subscription, no walled garden, your data stays yours

  • Bring your own broker — works with Kite Connect, Upstox, Fyers, Dhan, or free NSE snapshots

  • MCP-native — one config line gives your agent option chains, greeks and payoff math

Related MCP server: nse-mcp

Quickstart

pip install git+https://github.com/biranjan01/vikalp
# PyPI package (pip install vikalp) ships with the v0.2 release

Use from your AI agent (MCP)

{
  "mcpServers": {
    "vikalp": { "command": "vikalp-mcp" }
  }
}

Works in Claude Code, OpenCode, Cursor, Gemini CLI — any client that speaks MCP.

Use from Python

from vikalp.analytics.greeks import black_scholes, implied_vol
from vikalp.analytics.strategy import Strategy

# Single-leg fair value + greeks
price, g = black_scholes(spot=121.77, strike=121, t_days=8, iv=0.26, right="C")

# Multi-leg payoff: bull call spread
s = Strategy([
    {"strike": 121, "right": "C", "qty": 1, "premium": 2.78},
    {"strike": 125, "right": "C", "qty": -1, "premium": 0.90},
])
print(s.summary(spot=121.77))

MCP tools

Tool

What it does

option_chain

Live NSE option chain (LTP, OI, IV, volume) for any F&O underlying

greeks

Solve implied volatility from a market price, then full greeks + probabilities

strategy_payoff

Multi-leg payoff: breakevens, max loss/profit, risk-neutral P(profit)

max_pain

Max-pain strike + call/put walls for an expiry

analyze_position

Score an open option position: breakeven, VWAP filter, hold/exit levels

Roadmap

  • Core analytics engine (BS greeks, IV solver, payoff engine, max pain)

  • MCP server with 5 tools

  • Live data connectors: NSE snapshot, Upstox, Kite (bring-your-own key)

  • Position analyzer with intraday OI build-up classification

  • Web dashboard (chains, strategy builder, payoff charts)

  • Option-strategy backtester (event studies: expiry → expiry)

  • Hindi + English docs

Data & compliance

  • Market data is fetched live in your session from your own broker API keys or public NSE endpoints — Vikalp redistributes no exchange data.

  • NSE/BSE data is subject to exchange terms; use broker APIs for anything beyond personal use.

Disclaimer

Vikalp is an analysis tool, not investment advice. Options trading involves substantial risk of loss. Model outputs (greeks, probabilities) are estimates. Consult a registered advisor before trading.

License

MIT

Available Tools

5 tools
analyze_positionA

Score an open long option position: breakeven, current P&L, hold/exit framing.

Args: symbol: underlying symbol (for reporting) right: 'C' or 'P' strike: strike held entry: entry premium per share spot: current underlying price t_days: calendar days to expiry qty_shares: total shares (qty * lot_size), e.g. 6750 for 1 CANBK lot vwap: today's VWAP if known — adds the hold-above/exit-below filter iv: annualized IV; if omitted, estimated 0.28 (India F&O typical) — pass a real one when known

ParametersJSON Schema
NameRequiredDescriptionDefault
ivNo
spotYes
vwapNo
entryYes
rightYes
strikeYes
symbolYes
t_daysYes
qty_sharesYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It usefully discloses a default-injection behavior (IV estimated at 0.28 India F&O typical when omitted) and that vwap toggles a hold-above/exit-below filter, but it never says the tool is a pure computation with no side effects, nor how errors or missing inputs are handled.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose leads and the Args list follows; every line carries information that is unavailable in the schema. No filler sentences or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter computational tool with no output schema and no annotations, the description covers inputs well and summarizes the outputs at a high level. Edge cases (expiry-day handling, units for entry/spot) are left implicit, which keeps it just short of complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the Args block is doing all the work — and it does it: every one of the 9 parameters is documented with meaning, including 'C'/'P' for right, the lot-size multiplication example for qty_shares, and the vwap/iv conditional behavior. This is a genuine semantic upgrade over bare schema titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Score an open long option position') and enumerates the outputs (breakeven, current P&L, hold/exit framing). The 'open long position' scope implicitly separates it from market-wide siblings like option_chain, max_pain, and greeks, so an agent can route correctly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the scope (an already-held long option) and there is per-argument guidance ('vwap ... if known', 'pass a real one when known'), but the description never states when to choose this over siblings such as greeks or strategy_payoff, nor any exclusions for short/complex positions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

greeksA

Black-Scholes greeks for one option.

Args: spot: underlying spot price strike: option strike t_days: calendar days to expiry iv: annualized implied volatility as a decimal (0.26 = 26%) right: 'C' for call, 'P' for put market_price: if given, IV is re-solved from this price instead of using iv

ParametersJSON Schema
NameRequiredDescriptionDefault
ivYes
spotYes
rightNoC
strikeYes
t_daysYes
market_priceNo

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden. It discloses useful behavior by naming the Black-Scholes model and explaining that market_price causes IV to be re-solved instead of using the iv argument, but it omits assumptions such as risk-free rate/dividends and does not describe what greeks are returned.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the tool's purpose and then uses a compact Args list for parameter semantics. Every line contributes directly to invocation or interpretation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is sufficient to select and call the tool with correct parameter meanings, but it lacks return-value details and model assumptions. With no output schema and no annotations, more context about the returned greeks and calculation assumptions would improve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: it documents spot, strike, calendar days to expiry, annualized IV as a decimal, call/put right, and the market_price override behavior. This adds substantial meaning beyond the schema's bare titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific calculation and resource: "Black-Scholes greeks for one option." It is clear what the tool computes, though it does not explicitly differentiate itself from sibling tools such as option_chain or analyze_position.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It explains parameters but does not state usage contexts, exclusions, or when a sibling tool would be more appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

max_painB

Max pain, PCR and CE/PE walls for an underlying's live option chain.

Fetches the public NSE snapshot in-session (may be rate-limited; retry once after a pause if it fails).

ParametersJSON Schema
NameRequiredDescriptionDefault
symbolYes

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden, and it does disclose real behavioral traits: the snapshot is fetched from public NSE in-session and may be rate-limited, with a retry recommendation. However, it omits read-only status, permission/auth needs, latency, and failure modes beyond rate limiting.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tight sentences with the payload front-loaded; the second sentence adds operational value rather than filler. Nothing is wasted, though the parenthetical could be slightly more compact.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There are no annotations and no output schema, so the description must compensate more than it does. It names the three output metrics and flags rate limiting, but never explains the response shape, units, or behavior when the chain is unavailable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% for the single required 'symbol' parameter, so the description is the only source of meaning. 'For an underlying's' implies symbol is the underlying instrument, but it never states the required format (e.g., NSE ticker conventions), leaving a real gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Names specific outputs (max pain, PCR, CE/PE walls) for a specific resource (an underlying's live option chain), so the agent knows what it computes. It does not distinguish itself from the sibling option_chain, which likely overlaps heavily.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use or when-not-to-use guidance, and no sibling is named as an alternative. The agent must infer that this is the tool for max-pain/PCR analytics versus the broader option_chain.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

option_chainB

Live NSE option chain (LTP/OI/IV) around ATM for one underlying.

Args: symbol: NSE symbol, e.g. 'NIFTY', 'BANKNIFTY', 'CANBK', 'ULTRACEMCO' expiry: filter, e.g. '27-Oct-2026' (defaults to nearest expiry) atm_band: how many strikes either side of the money to return

ParametersJSON Schema
NameRequiredDescriptionDefault
expiryNo
symbolYes
atm_bandNo

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full behavioral burden. It discloses that data is live NSE data and includes LTP/OI/IV around ATM, but it does not mention authentication, rate limits, whether data is delayed, error behavior for invalid expiries, or the response shape.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is short and front-loaded: the core behavior appears first, followed by compact parameter notes. Every sentence adds useful information without repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter tool with no annotations and no output schema, the description gives enough to invoke it and identifies the returned metrics (LTP/OI/IV). It still lacks a fuller picture of the response structure and operational constraints such as rate limits or error handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it does: symbol examples are provided, expiry is described as a filter with format and default behavior, and atm_band is explained as the number of strikes either side of the money. Minor gaps remain, such as not restating the atm_band default of 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific resource and scope: a live NSE option chain around ATM for one underlying, including LTP/OI/IV. It is clear what the tool returns, but it does not explicitly differentiate itself from siblings such as max_pain or greeks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the data type: use this when you need an option chain around ATM. However, there is no explicit when-to-use guidance, no exclusions, and no comparison to sibling tools like max_pain or greeks.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

strategy_payoffA

Payoff analysis for a multi-leg option strategy at expiry.

Args: legs: list of {strike, right ('C'/'P'), qty (+ long / - short), premium, lot_size?} spot: current underlying price t_days: calendar days to expiry iv: annualized IV for probability estimate (decimal) lot_size: shares per contract (e.g. 6750 for CANBK), or use per-leg lot_size

ParametersJSON Schema
NameRequiredDescriptionDefault
ivNo
legsYes
spotYes
t_daysNo
lot_sizeNo

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden; it does disclose meaningful behavior — the analysis is expiry-only, and iv drives a probability estimate rather than a valuation. However it says nothing about output shape (payoff curve vs. scalar), whether it is a pure computation with no side effects, or any rate/limit characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The scope sentence is front-loaded, and the Args list is compact and scannable, with the critical sign convention given inline in parentheses. Slightly information-dense but no filler sentences.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter analytical tool with no annotations and no output schema, the input side is covered well, but the description never says what the tool returns (payoff at expiry per spot? breakeven? probability?) or in what units, leaving the agent unable to anticipate the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the embedded Args block does all the work: it defines each leg field (strike, right 'C'/'P', qty signed + long / - short, premium, optional per-leg lot_size) plus units for spot, calendar days for t_days, and decimal annualized IV. This resolves ambiguities the bare schema (array of additionalProperties objects) leaves completely open.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb+resource+scope: payoff analysis for a multi-leg option strategy, explicitly at expiry. It is distinguishable from max_pain and greeks by the 'payoff at expiry' framing, though it never explicitly contrasts itself with analyze_position, which sounds like the nearest sibling.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites (e.g. whether live market data is needed), and no mention of when to prefer analyze_position, greeks, or max_pain instead. The 'at expiry' scope is stated but the agent must infer when this tool is the right choice.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv0.1.0
    • First observedanalyze_position
    • First observedgreeks
    • First observedmax_pain
    • First observedoption_chain
    • First observedstrategy_payoff

TDQS

A3.7/5.0

Scored across 5 tools

Disambiguation4/5

Each tool targets a distinct analytical task: live chain data, max-pain metrics, single-option greeks, multi-leg payoff, and position scoring. However, `greeks` and `analyze_position` both accept similar option inputs and could be confused, and `max_pain` also fetches the chain, creating minor overlap.

Naming Consistency4/5

All names use snake_case and are descriptive, but the convention is mostly noun phrases (option_chain, strategy_payoff, max_pain, greeks) with one verb_noun outlier (analyze_position), so it is not fully uniform.

Tool Count5/5

Five tools is well within the ideal 3–15 range and each covers a distinct facet of options analytics, so no tool feels redundant.

Completeness4/5

Core options analytics are covered: live chain, greeks, payoff, max pain, and position scoring. Minor gaps exist (e.g., listing expiries, multi-leg position analysis, or volatility surface), but agents can likely work around them.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Indian stock market (NSE & BSE) MCP server with 55 tools: live quotes, financials, technicals, a 326-ratio screener, FII/DII flows, option chains with IV, parsed annual reports and concall transcripts, IPOs and portfolio tracking for ~8,200 stocks.
    55
    430 npm
    140
    MIT
  • F
    license
    C
    quality
    B
    maintenance
    Enables AI assistants to access National Stock Exchange of India (NSE) data, including live quotes, market status, indices, option chains, corporate actions, and historical data, through natural language.
    24
    1
    -
  • A
    license
    A
    quality
    C
    maintenance
    Gives AI assistants live Indian market data without any API keys, spanning NSE quotes and indices, option chains with Greeks, max pain and OI analytics, company financials, shareholding and corporate actions, plus mutual fund NAVs and trailing returns. It also ships research, market-brief and options-positioning prompts so users can compare stocks, trace sector leadership or size up an expiry through natural language.
    13
    MIT