Skip to main content
Glama

Black-Scholes MCP Server

Black-Scholes MCP Server

This project provides a Model Context Protocol (MCP) server for calculating the price and Greeks of European options using the Black-Scholes model.

Features

  • Calculate the Black-Scholes price for European call and put options
  • Compute option Greeks and higher-order Greeks:
    • Delta
    • Vega
    • Theta
    • Gamma
    • Rho
    • Lambda
    • Epsilon
    • Vanna
    • Charm
    • Vomma
    • Veta
    • Speed
    • Zomma
    • Color
    • Ultima
    • Vera

Usage

Installation and Usage

  1. Install dependencies (if using uv):
    uv pip install -r requirements.txt
    Or use your preferred Python package manager.
  2. Install this MCP server to Claude:
    uv run mcp install main.py
    This command will add the configuration to claude_desktop_config.json so that Claude can use this MCP server.
  3. (Optional) Run the MCP server directly:
    python main.py
  4. Use the MCP tools to calculate option prices and Greeks by providing the following arguments:
    • S: Spot price
    • K: Strike price
    • T: Time to maturity (in years)
    • r: Risk-free rate (annual, decimal)
    • q: Dividend yield (annual, decimal)
    • vol: Volatility (annual, decimal)
    • type: "call" or "put"

Running Tests

To run the tests for this project:

  1. Install the package in development mode:
    pip install -e .
  2. Run tests using unittest:
    python -m unittest discover -s tests
    Or with pytest (after installing pytest from requirements.txt):
    python -m pytest
  3. To run specific test modules:
    python -m unittest tests.calculators.test_black_scholes_price
    Or with pytest:
    python -m pytest tests/calculators/test_black_scholes_price.py

Acknowledgements

This project uses the modelcontextprotocol/python-sdk for MCP server implementation.

License

This project is licensed under the MIT License. See LICENSE for details.

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Позволяет рассчитывать европейские цены опционов и «греки» (такие как Delta, Vega, Theta) с использованием модели Блэка-Шоулза посредством реализации протокола контекста модели.

  1. Функции
    1. Использование
      1. Установка и использование
    2. Проведение тестов
      1. Благодарности
        1. Лицензия

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that enables LLMs to analyze options chains, calculate Greeks, and evaluate basic options strategies through Yahoo Finance data.
            Last updated -
            13
            Python
            MIT License
            • Apple
            • Linux
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables LLMs to perform precise numerical calculations by evaluating mathematical expressions.
            Last updated -
            1
            104
            Python
            MIT License
            • Linux
            • Apple
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol tool that retrieves daily stock market data for any stock symbol using the Alpha Vantage API.
            Last updated -
            7
            2
            1
            TypeScript
            Apache 2.0
          • -
            security
            F
            license
            -
            quality
            A cryptocurrency price query service based on Model Context Protocol that provides tools for retrieving virtual currency prices, market trends, detailed information, and K-line data.
            Last updated -
            2
            Python

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/walkingshamrock/black-scholes-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server