Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
46c9fda
Add MCP (Model Context Protocol) server support
bullish-lee Jan 1, 2026
106dd4e
fix(mcp): Address code review feedback
bullish-lee Jan 2, 2026
54ca018
fix(mcp): Fix remaining lint errors and improve robustness
bullish-lee Jan 2, 2026
f59494f
fix(mcp): Fix CI formatting and skip tests when mcp not installed
bullish-lee Jan 2, 2026
549db00
refactor(mcp): Address code review feedback
bullish-lee Jan 2, 2026
385a3da
fix(mcp): Address all code review feedback
bullish-lee Jan 2, 2026
259889b
fix(mcp): Address CLAUDE.md Rule #4 and security concerns
bullish-lee Jan 2, 2026
b171592
fix(mcp): Address PR review - CLAUDE.md compliance and error handling
bullish-lee Jan 2, 2026
9c80d21
fix(mcp): Address critical security and resource issues
bullish-lee Jan 2, 2026
0ae3171
fix(mcp): Address all PR review must-fix items
bullish-lee Jan 2, 2026
652a8c2
docs: Fix placeholder GitHub URLs in MCP guide
bullish-lee Jan 2, 2026
a0f3433
docs: Add MCP Server section to README for open source users
bullish-lee Jan 2, 2026
84cf87c
docs: Fix placeholder formatting in MCP guide
bullish-lee Jan 2, 2026
5ef5c32
docs: Remove real wallet addresses from MCP guide examples
bullish-lee Jan 2, 2026
842618a
fix(mcp): Implement PR review feedback and improve signature type docs
bullish-lee Jan 3, 2026
707f365
fix(mcp): Address all PR review critical and quality issues
bullish-lee Jan 3, 2026
61b621a
fix(mcp): Fix CI formatting and skip tests when mcp not installed
bullish-lee Jan 3, 2026
9ea9681
fix(mcp): Address all 3rd PR review critical and quality issues
bullish-lee Jan 3, 2026
9cbb5cb
fix(mcp): Address 5th review - register missing tools and improve tests
bullish-lee Jan 3, 2026
5b06214
style(mcp): Fix formatting in test files
bullish-lee Jan 3, 2026
22242f5
fix(mcp): Fix stdout pollution causing JSON-RPC parse errors
bullish-lee Jan 3, 2026
c5c66cf
fix(mcp): Fix duration_minutes parameter bug in create_strategy_session
bullish-lee Jan 3, 2026
397d6c2
chore: Update .env.example and README for new trading configurations
guzus Jan 7, 2026
17e925e
feat(mcp): Add search_markets tool for keyword-based market retrieval
guzus Jan 7, 2026
6c7aa90
fix(mcp): Improve tool descriptions for better AI tool selection
bullish-lee Jan 8, 2026
ee94a56
Merge branch 'main' into feature/add-mcp-server
guzus Jan 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ LIMITLESS_PRIVATE_KEY=0x1234567890abcdef...

# TODO: OpenRouter API (for LLM-based market matching)
OPENROUTER_API_KEY=sk-or-...
OPENROUTER_MODEL=xiaomi/mimo-v2-flash:free
OPENROUTER_MODEL=xiaomi/mimo-v2-flash:free
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ Thumbs.db
*.log
.cache/

# Development/Testing files (not for commit)
.dev/

.references/

.claude/
Expand Down
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ dr_manhattan/
- Order tracking and event logging
- Standardized error handling
- Exchange-agnostic code
- **MCP server for Claude Desktop integration**

## Installation

Expand Down Expand Up @@ -150,6 +151,60 @@ print(list_exchanges()) # ['polymarket', 'limitless', 'opinion']
exchange = create_exchange('polymarket', {'timeout': 30})
```

### MCP Server

Trade prediction markets directly from Claude using the Model Context Protocol (MCP).

```bash
# Install with MCP dependencies
uv sync --extra mcp

# Configure credentials
cp .env.example .env
# Edit .env with your POLYMARKET_PRIVATE_KEY and POLYMARKET_FUNDER
```

#### Claude Code

Add to `~/.claude/settings.json` or project `.mcp.json`:

```json
{
"mcpServers": {
"dr-manhattan": {
"command": "/path/to/dr-manhattan/.venv/bin/python",
"args": ["-m", "dr_manhattan.mcp.server"],
"cwd": "/path/to/dr-manhattan"
}
}
}
```

Restart Claude Code and verify with `/mcp`.

#### Claude Desktop

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

```json
{
"mcpServers": {
"dr-manhattan": {
"command": "/path/to/dr-manhattan/.venv/bin/python",
"args": ["-m", "dr_manhattan.mcp.server"],
"cwd": "/path/to/dr-manhattan"
}
}
}
```

After restarting, you can:
- "Show my Polymarket balance"
- "Find active prediction markets"
- "Buy 10 USDC of Yes on market X at 0.55"

See [examples/mcp_usage_example.md](examples/mcp_usage_example.md) for the complete setup guide.

## Adding New Exchanges

To add a new exchange, create a class that inherits from `Exchange`:
Expand Down Expand Up @@ -222,6 +277,7 @@ All errors inherit from `DrManhattanError`:

Check out the [examples/](examples/) directory for working examples:

- **mcp_usage_example.md** - Complete MCP server setup and usage guide for Claude Desktop
- **list_all_markets.py** - List markets from any exchange
- **spread_strategy.py** - Exchange-agnostic BBO market making strategy

Expand Down
8 changes: 8 additions & 0 deletions dr_manhattan/mcp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""
Dr. Manhattan MCP Server

MCP (Model Context Protocol) server for prediction market trading.
Provides AI agents with access to all Dr. Manhattan functionality.
"""

__version__ = "0.0.2"
Loading