npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

public-com-mcp

v1.0.0

Published

MCP Server for Public.com stock and options trading APIs

Readme

Public.com MCP Server

An MCP (Model Context Protocol) server that provides AI assistants with access to Public.com's stock and options trading APIs.

Features

  • Real-time market data - Stock and crypto quotes, bid/ask spreads, volume
  • Options analytics - Chains, expirations, Greeks (delta, gamma, theta, vega, rho, IV)
  • Portfolio management - View positions, equity, buying power, transaction history
  • Order placement - Single-leg and multi-leg orders with safety guards
  • Pre-trade analysis - Preflight calculations for cost estimates before trading

Prerequisites

Installation

Via npm

npm install -g public-com-mcp

Via npx (no install)

npx public-com-mcp

From source

git clone https://github.com/Gajesh2007/public-com-mcp.git
cd public-com-mcp
bun install

Configuration

Edit .env with your credentials:

# Required - your API secret key
PUBLIC_API_SECRET_KEY=your-api-secret-key

# Optional - default account ID (use get_accounts to find yours)
PUBLIC_DEFAULT_ACCOUNT_ID=

# Safety - set to "true" to enable live trading (default: false)
ENABLE_TRADING=false

Usage

With Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

Using npx (easiest):

{
  "mcpServers": {
    "public-stocks": {
      "command": "npx",
      "args": ["public-com-mcp"],
      "env": {
        "PUBLIC_API_SECRET_KEY": "your-api-key"
      }
    }
  }
}

Using global install:

{
  "mcpServers": {
    "public-stocks": {
      "command": "public-com-mcp",
      "env": {
        "PUBLIC_API_SECRET_KEY": "your-api-key"
      }
    }
  }
}

Using Bun (from source):

{
  "mcpServers": {
    "public-stocks": {
      "command": "bun",
      "args": ["run", "/path/to/public-com-mcp/src/index.ts"]
    }
  }
}

Standalone

# Via npx
npx public-com-mcp

# Via global install
public-com-mcp

# From source with Bun
bun run src/index.ts

Development

# Run with hot reload
bun run dev

# Build for distribution
bun run build

# Run tests
bun test

Available Tools

Market Data

| Tool | Description | |------|-------------| | get_quote | Get real-time quote for a single symbol | | get_quotes | Batch quotes for multiple symbols (max 50) | | get_instrument | Get trading capabilities for a symbol | | search_instruments | Search/filter available instruments |

Options

| Tool | Description | |------|-------------| | get_option_expirations | List available expiration dates | | get_option_chain | Full options chain for an expiration | | get_option_greeks | Greeks for option contracts |

Account

| Tool | Description | |------|-------------| | get_accounts | List your trading accounts | | get_portfolio | Portfolio snapshot with positions | | get_account_history | Transaction history |

Orders

| Tool | Description | |------|-------------| | preflight_order | Estimate costs before placing | | preflight_multileg | Estimate multi-leg strategy costs | | place_order | Place single-leg order* | | place_multileg_order | Place options spread* | | cancel_order | Cancel pending order* | | get_order | Check order status |

*Requires ENABLE_TRADING=true

Example Prompts

Once connected to Claude, you can ask:

  • "What's the current price of AAPL?"
  • "Show me the options chain for SPY expiring next Friday"
  • "What are the Greeks for AAPL 250 calls expiring in February?"
  • "What's in my portfolio?"
  • "How much would it cost to buy 10 shares of NVDA?"

Safety

Trading is disabled by default. The place_order, place_multileg_order, and cancel_order tools will not execute unless ENABLE_TRADING=true is set in your environment.

When trading is disabled, you can still:

  • View real-time quotes and market data
  • Analyze options chains and Greeks
  • View your portfolio and account history
  • Run preflight calculations to estimate order costs

Project Structure

src/
├── index.ts          # Entry point (stdio transport)
├── server.ts         # MCP server configuration
├── client/
│   ├── types.ts      # TypeScript type definitions
│   ├── auth.ts       # API token management
│   └── public-api.ts # HTTP client for Public.com
├── tools/
│   ├── market-data.ts # Quote & instrument tools
│   ├── options.ts     # Options chain & Greeks
│   ├── account.ts     # Portfolio & history
│   └── orders.ts      # Order placement (guarded)
└── schemas/
    └── index.ts       # Zod validation schemas

License

MIT

Disclaimer

This software is provided as-is. Trading stocks and options involves risk. Always verify orders before enabling live trading. The authors are not responsible for any financial losses.