Getting Started¶
Get up and running with Prediction Markets MCP in under 5 minutes.
Prerequisites¶
- Node.js v18+ (for
npx) or Bun v1.0+ (forbunx) - An MCP-compatible client (see supported clients below)
Installation¶
This server is published on npm. No cloning or building required—just configure your MCP client to run it via npx.
Register with Your MCP Client¶
Choose your client and follow the setup instructions.
Configuration may vary
MCP client configuration varies by tool—some support project-level, user-level, or both. The examples below show typical setups. Check your client's official documentation for the latest details.
Restart often required
Most MCP clients load servers at startup. After adding or updating configuration, you may need to restart your client (or use a refresh button, depending on the client) to load changes.
Add to .mcp.json in your project or ~/.claude.json for global access:
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Using Bun? Replace "command": "npx", "args": ["-y", "prediction-mcp"] with "command": "bunx", "args": ["prediction-mcp"].
Edit claude_desktop_config.json at the path for your OS:
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
Quick access
In Claude Desktop: Settings → Developer → Edit Config
Add the following configuration:
VS Code has native MCP support.
Option 1: Workspace configuration
Create .vscode/mcp.json in your project:
{
"servers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Option 2: Command Palette
- Open Command Palette (Ctrl/Cmd + Shift + P)
- Run MCP: Add Server
- Enter the server configuration
More info
See VS Code MCP documentation for advanced features like input prompts and HTTP transport.
Create .cursor/mcp.json in your project root, or ~/.cursor/mcp.json for global access:
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Alternative: Settings UI
- Go to File → Preferences → Cursor Settings
- Select MCP
- Click Add Custom MCP
More info
See Cursor MCP documentation for environment variable interpolation and advanced configuration.
Edit the MCP config file at ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Alternative: Plugin Store
- Click the Plugins icon in the Cascade panel
- Or go to Windsurf Settings → Cascade → Plugins
More info
See Windsurf MCP documentation for team administration and whitelisting.
Add to your Zed settings.json (Preferences → Settings):
{
"context_servers": {
"prediction-markets": {
"command": "npx",
"args": ["-y", "prediction-mcp"],
"env": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
Check the server status in the Agent Panel settings—a green indicator means it's active.
More info
See Zed MCP documentation for extension-based MCP servers.
Create opencode.jsonc in your project root:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"prediction-markets": {
"type": "local",
"command": ["npx", "-y", "prediction-mcp"],
"enabled": true,
"environment": {
"KALSHI_API_KEY": "your-api-key",
"KALSHI_PRIVATE_KEY_PATH": "/path/to/key.pem"
}
}
}
}
More info
See OpenCode MCP documentation for remote servers and OAuth configuration.
Verify It Works¶
Ask your AI assistant:
"List open markets on Kalshi about the Federal Reserve"
Or for Polymarket (no credentials needed):
"What are the top markets on Polymarket right now?"
If the server is working, you'll see market data in the response. If not, see Troubleshooting.
Credentials¶
Polymarket¶
No credentials required. All Polymarket tools work out of the box—read operations are public.
Kalshi¶
Kalshi requires API credentials:
- Create an account at kalshi.com
- Go to kalshi.com/account/profile
- Generate an API key and download your private key
Demo environment
Kalshi offers a demo environment with mock funds for testing. Demo credentials are separate from production—create a demo account at demo.kalshi.co first, then set KALSHI_USE_DEMO=true in your configuration.
See Configuration for all environment variables.
Next Steps¶
- Configuration — Environment variables and advanced setup
- Tools Reference — Complete tool documentation with parameters
- Troubleshooting — Common issues and solutions