Skip to main content
Glama
compute-mcp

compute-mcp

README.md
# compute-mcp

Sandboxed code execution + real-time financial data for AI agents.

[![MCP](https://img.shields.io/badge/MCP-Compatible-blue)](https://modelcontextprotocol.io)
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)

## Features

**🖥️ Code Execution**
- Python, JavaScript, Shell in isolated sandbox
- Configurable timeouts
- Returns stdout, stderr, exit code

**📈 Financial Data**
- Real-time stock quotes (AAPL, MSFT, etc.)
- Cryptocurrency prices (BTC, ETH, SOL)
- Historical price data
- Technical indicators (RSI, MACD, SMA, EMA)
- Company fundamentals
- Market news with sentiment analysis
- Top gainers/losers

## Quick Start

### As MCP Server (Claude, Cursor, etc.)

```json
{
  "mcpServers": {
    "compute-mcp": {
      "url": "https://your-server.com/mcp"
    }
  }
}
```

### Run Locally

```bash
npm install
ALPHA_VANTAGE_KEY=your_key node http-server-v3.js
```

## Tools

| Tool | Description |
|------|-------------|
| `run_python` | Execute Python code |
| `run_javascript` | Execute JavaScript/Node.js code |
| `run_shell` | Execute shell commands |
| `get_stock_quote` | Real-time stock price |
| `get_crypto_price` | Cryptocurrency price |
| `get_stock_history` | Historical prices |
| `get_technical_indicator` | RSI, MACD, SMA, EMA |
| `get_company_overview` | Company fundamentals |
| `get_market_news` | News with sentiment |
| `get_market_movers` | Top gainers/losers |

## API Endpoints

### MCP Protocol
- `POST /mcp` - JSON-RPC endpoint
- `GET /.well-known/mcp/server-card.json` - Server discovery

### REST API
- `POST /run/python` - Execute Python
- `POST /run/javascript` - Execute JavaScript
- `POST /run/shell` - Execute shell
- `GET /finance/quote/:symbol` - Stock quote
- `GET /finance/crypto/:symbol` - Crypto price
- `GET /finance/history/:symbol` - Price history
- `GET /yahoo/quote/:symbol` - Yahoo Finance quote

## Environment Variables

```bash
ALPHA_VANTAGE_KEY=your_key  # Get free key at alphavantage.co
PORT=3457                    # Server port (default: 3457)
```

## License

MIT