Codeprism
An experimental, 100% AI-generated, high-performance code intelligence server providing AI assistants with a graph-based understanding of codebases.
Install / Use
/learn @rustic-ai/CodeprismQuality Score
Category
Development & EngineeringSupported Platforms
README
🤖 CodePrism - 100% AI-Generated Code Intelligence MCP Server
⚠️ IMPORTANT: This project is entirely AI-generated. Not a single byte of code, documentation, or configuration has been written by humans. This is an experimental project showcasing the capabilities of AI-driven software development.
A production-ready, high-performance code intelligence server implementing the Model Context Protocol (MCP). CodePrism provides AI assistants with structured understanding of codebases through graph-based analysis, enabling real-time, accurate code intelligence.
🤖 The AI-Only Development Experiment
This project represents a unique experiment in software development:
- 100% AI-Generated: Every line of code, documentation, test, and configuration is written by AI agents
- No Human Code: We do not accept human-written code contributions or pull requests
- Single AI Developer: The entire project is maintained by a single AI coding agent
- Continuous AI Evolution: Features, fixes, and improvements are all AI-driven
Want to contribute? See our Contributing Guidelines for exciting ways to participate without writing code!
🚀 Current Status: Production Ready
✅ 20 Production-Ready Tools - 100% success rate, no failed tools
✅ Full MCP Compliance - JSON-RPC 2.0 with complete protocol implementation
✅ Multi-Language Support - JavaScript/TypeScript + Python with advanced analysis
✅ Semantic APIs - User-friendly parameter names, no cryptic IDs required
✅ Environment Integration - Automatic repository detection via REPOSITORY_PATH
✅ Parser Development Tools - Complete debugging and development toolkit
💝 Primary Sponsor
<div align="center"> <a href="https://dragonscale.ai" target="_blank"> <img src="https://cdn.prod.website-files.com/65577aeb720145c27d810263/66296bc4e8282c4a362065f5_logo.svg" alt="Dragonscale Industries Inc" width="200"/> </a> </div>CodePrism is proudly sponsored by Dragonscale Industries Inc, pioneers in AI innovation and development tools.
Dragonscale Industries Inc supports the development of cutting-edge AI-powered code intelligence, enabling CodePrism to remain open-source and freely available to the developer community. Their commitment to advancing AI technology makes projects like CodePrism possible.
Become a sponsor → | Learn more about sponsorship →
🌟 Key Features
20 Advanced Analysis Tools
- Core Navigation (4 tools): Repository stats, symbol explanation, path tracing, dependency analysis
- Search & Discovery (4 tools): Symbol search, content search, file finding, content statistics
- Analysis Tools (11 tools): Complexity analysis, data flow tracing, pattern detection, inheritance analysis, security analysis, performance analysis, API surface analysis, unused code detection, duplicate detection, transitive dependencies, decorators
- Workflow Orchestration (4 tools): Batch processing, workflow suggestions, optimization guidance, reference analysis
Parser Development Tools
- AST Visualization: Pretty-print syntax trees with multiple formats (Tree, JSON, GraphViz)
- Parser Validation: Comprehensive validation of nodes, edges, and spans with detailed reports
- Development REPL: Interactive command-line interface for parser development and testing
- Performance Profiling: Real-time parsing performance metrics with bottleneck detection
- AST Diff Analysis: Compare parse results between parser versions with change impact analysis
- GraphViz Export: Visual AST diagrams with configurable styling and clustering
Advanced Python Analysis
- Inheritance Tracing: Complete hierarchy analysis with metaclass support
- Decorator Analysis: Framework detection (Flask, Django, FastAPI) and pattern recognition
- Metaprogramming Support: Complex pattern detection and dynamic behavior analysis
Graph-First Intelligence
- Universal AST: Language-agnostic code structure representation
- Relationship Mapping: Function calls, imports, dependencies, inheritance
- Real-time Updates: Sub-millisecond incremental parsing
- Efficient Queries: Fast graph traversal and semantic search
🏗️ Architecture
┌─────────────────┐ MCP Protocol ┌──────────────────┐
│ AI Assistant │◄──────────────────►│ codeprism-mcp-server │
│ (Claude/Cursor)│ JSON-RPC 2.0 │ Server │
└─────────────────┘ └──────────────────┘
│
┌────────────┴────────────┐
┌───────────────▼───────────────▼─────────────────┐
│ 20 MCP Tools │
│ ┌─────────────┐ ┌─────────────────────────┐ │
│ │ Core │ │ Search & Discovery │ │
│ │ Navigation │ │ 4 tools │ │
│ │ 4 tools │ └─────────────────────────┘ │
│ └─────────────┘ ┌─────────────────────────┐ │
│ ┌─────────────┐ │ Analysis │ │
│ │ Workflow │ │ 11 tools │ │
│ │ 4 tools │ │ │ │
│ └─────────────┘ └─────────────────────────┘ │
└─────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Graph-Based Code Analysis │
│ JavaScript/TypeScript + Python Support │
└─────────────────────────────────────────────────┘
🧪 Mandrel MCP Test Harness
NEW: CodePrism now includes the Mandrel MCP Test Harness - a comprehensive testing framework for MCP servers built on the official Rust SDK.
moth - MOdel context protocol Test Harness
# Install and run moth binary
cargo install --path crates/mandrel-mcp-th
# Test MCP servers with YAML specifications
moth test filesystem-server.yaml
# Validate test specifications
moth validate filesystem-server.yaml
Key Features
- ✅ SDK-First: Built on official MCP Rust SDK for guaranteed protocol compliance
- ✅ Transport Agnostic: Supports stdio, HTTP, and SSE transports
- ✅ Comprehensive Testing: Protocol compliance, capability validation, and stress testing
- ✅ Rich Reporting: HTML, JSON, and JUnit XML report formats
🚀 Quick Start
Prerequisites
- Rust 1.82+ (for building from source)
- Any repository to analyze (JavaScript, Python, TypeScript, or mixed)
Installation
# Clone and build
git clone https://github.com/rustic-ai/codeprism
cd codeprism
cargo build --release
# Verify installation
./target/release/codeprism --help
⚠️ Development Note: This project enforces strict implementation completeness standards via git pre-commit hooks. All commits must contain complete, functional implementations with zero placeholder code. The existing .git/hooks/pre-commit script automatically validates code quality and implementation completeness.
MCP Client Integration
📝 Note on Repository Setup: The server starts without a specific repository. Once connected via MCP, use any analysis tool (like
repository_stats) and the server will prompt you to specify the repository path, then automatically initialize and index it.
🏆 Claude Desktop - Best overall MCP experience
// ~/.config/claude-desktop/claude_desktop_config.json
{
"mcpServers": {
"codeprism": {
"command": "/path/to/codeprism/target/release/codeprism",
"args": ["--mcp"],
"env": {
"CODEPRISM_PROFILE": "development",
"RUST_LOG": "info"
}
}
}
}
⚡ Cursor - AI pair programming with code intelligence
// .cursor/mcp.json
{
"mcpServers": {
"codeprism": {
"command": "/path/to/codeprism/target/release/codeprism",
"args": ["--mcp"],
"env": {
"CODEPRISM_PROFILE": "development",
"RUST_LOG": "info"
}
}
}
}
🔧 Manual Usage - Direct stdio communication
# Set configuration and run
export CODEPRISM_PROFILE=development
export RUST_LOG=info
./target/release/codeprism --mcp
🛠️ Available Tools
Core Navigation & Understanding
repository_stats- Get comprehensive repository overview and statisticsexplain_symbol- Detailed symbol analysis with context (accepts semantic names like "UserManager")trace_path- Find execution paths between code elementsfind_dependencies- Analyze what a symbol or file depends on
Search & Discovery
search_symbols- Advanced symbol search with regex and inheritance filteringsearch_content- Full-text search across all repository contentfind_files- File discovery with glob and regex pattern supportcontent_stats- Detailed content and complexity statistics
