Saturn Semantic Code Knowledge Graph + MCP Server
A local first code intelligence server that turns your repository into a queryable knowledge graph for AI coding agents (Claude, Cursor, Aider, etc.)
- What is Saturn?
- Features
- Quick Start
- How to Run
- Available Tools
- Project Structure
- Architecture Highlights
- Connecting to AI Agents
- Troubleshooting
- Roadmap
Saturn is a local first semantic code graph server built for AI coding agents. It parses your codebase using Tree sitter, builds a rich knowledge graph in SQLite, and exposes structured tools via the Model Context Protocol (MCP).
It works with:
- Terminal agents (Claude Code, Cursor, Aider, etc.) via stdio
- claude.ai via SSE + Cloudflare Tunnel
- Multi-language AST parsing (Go, Python, JavaScript/TypeScript, Rust)
- Semantic knowledge graph with functions, classes, calls, routes, and more
- 14 tools for agents (
trace_callers,run_impact_analysis,validate_patch, etc.) - Incremental file watching (only re indexes changed files)
- Docker sandbox for safe code execution (
validate_patch) - Cloudflare tunnel integration for claude.ai
- Cost and usage tracing
- Fast and lightweight (Node.js + SQLite)
git clone https://github.com/arijiiiitttt/saturn
cd saturn
bun installbun start
# or
node src/index.jsBy default, Saturn indexes your current directory (.).
node src/index.js --repo /path/to/your/project| Flag | Description | Default |
|---|---|---|
--repo |
Path to repository | . |
--db |
Database file | .saturn.db |
--port |
SSE server port | 3333 |
--workers |
Number of AST parser workers | 8 |
--no-tunnel |
Disable Cloudflare tunnel | false |
--no-stdio |
Disable stdio transport | false |
node src/index.js --repo ~/Projects/my-awesome-app --port 4444Saturn exposes these tools to AI agents:
get_architectureβ Full repo overviewfind_symbolβ Search any symboltrace_callers/trace_calleesβ Call graph traversalrun_impact_analysisβ See what a change would breakfind_dead_codeβ Unused code detectionget_http_routesβ All API routes across frameworksvalidate_patchβ Run code safely in a Docker sandboxrefresh_index,get_file_symbols,detect_clusters, and more
saturn/
βββ src/
β βββ index.js # Entry point
β βββ ast/ # Tree-sitter parsing + extractors
β βββ db/ # SQLite schema + queries
β βββ mcp/ # MCP server + tool handlers
β βββ sandbox/ # Docker code execution
β βββ watcher/ # File change detection
β βββ tunnel/ # Cloudflare tunnel
β βββ tracer/ # Usage & cost tracking
βββ .saturn.db # Knowledge graph database
βββ package.json
- Tree-sitter for accurate multi-language parsing
- Worker threads for fast parallel indexing
- SQLite + WAL for reliable storage
- Incremental updates via file watcher
- Isolated Docker sandbox for testing patches
- Dual transport (stdio + SSE)
Just run Saturn β it connects automatically via stdio.
- Run Saturn (the tunnel starts automatically)
- Open
claude.ai - Go to Settings β Integrations
- Add a custom integration using the URL shown in your terminal
| Issue | Solution |
|---|---|
cloudflared not installed |
Install via brew or the official instructions |
| Docker sandbox not working | Start Docker Desktop |
| Indexing too slow | Increase --workers |
| Port already in use | Use --port 4444 |
| Database corrupted | Delete .saturn.db and restart |
- More language support (Java, C#, PHP, etc.)
- Better cluster detection
- Graph visualization UI
- Remote MCP support
- Advanced query language
Contributions, stars, and feedback are welcome!
