PeerCortex unifies PeeringDB, RIPE Stat, bgproutes.io, RIPE Atlas, Route Views, IRR, RPKI, and CAIDA into a single AI-queryable MCP Server for network engineers. Powered by local Ollama. Core capabilities: - 34 MCP tools for network intelligence - 11 data sources unified - ASPA validation engine (RFC 9582) with leak detection - Peering partner discovery with AI-ranked matches - BGP analysis and anomaly detection - RPKI monitoring and compliance reports - Latency/traceroute via RIPE Atlas - Transit analysis and cost comparison - IX traffic statistics - AS topology mapping - ASPA object generator and simulator - 100% local AI — no cloud dependencies
2.4 KiB
2.4 KiB
Setup Guide
Prerequisites
- Node.js 20+ (LTS recommended)
- Ollama installed and running locally
- Docker (optional, for containerized deployment)
Quick Start
1. Install Ollama
# macOS
brew install ollama
# Linux
curl -fsSL https://ollama.com/install.sh | sh
# Pull a recommended model
ollama pull llama3.1
2. Install PeerCortex
# Clone the repository
git clone https://github.com/peercortex/peercortex.git
cd peercortex
# Install dependencies
npm install
# Copy environment configuration
cp .env.example .env
# Build
npm run build
# Start the MCP server
npm start
3. Configure Claude Code
Add PeerCortex to your Claude Code MCP configuration:
{
"mcpServers": {
"peercortex": {
"command": "node",
"args": ["/path/to/peercortex/dist/mcp-server/index.js"],
"env": {
"OLLAMA_BASE_URL": "http://localhost:11434",
"OLLAMA_MODEL": "llama3.1"
}
}
}
}
4. Docker Setup (Alternative)
# Start PeerCortex with Ollama
docker compose up -d
# Pull the AI model inside the Ollama container
docker exec peercortex-ollama ollama pull llama3.1
Configuration Reference
See .env.example for all available configuration options.
| Variable | Default | Description |
|---|---|---|
OLLAMA_BASE_URL |
http://localhost:11434 |
Ollama API endpoint |
OLLAMA_MODEL |
llama3.1 |
LLM model for analysis |
PEERINGDB_API_KEY |
(empty) | Optional PeeringDB API key |
RIPE_STAT_SOURCE_APP |
peercortex |
RIPE Stat source app identifier |
ROUTINATOR_URL |
http://localhost:8323 |
Routinator RPKI validator URL |
CACHE_DB_PATH |
./peercortex-cache.db |
SQLite cache file path |
CACHE_TTL_SECONDS |
3600 |
Default cache TTL |
MCP_TRANSPORT |
stdio |
Transport protocol (stdio/sse) |
LOG_LEVEL |
info |
Logging level |
Optional: PeeringDB API Key
PeerCortex works without a PeeringDB API key, but you'll hit rate limits faster. To get a free API key:
- Create an account at peeringdb.com
- Go to your profile settings
- Generate an API key
- Add it to your
.envfile
Optional: Local RPKI Validator
For faster RPKI validation, run Routinator locally:
# Via Docker
docker run -d --name routinator -p 8323:8323 nlnetlabs/routinator
# Or uncomment the routinator service in docker-compose.yml