CodePrism MCP Server Overview
CodePrism provides a production-ready MCP server that enables AI assistants to understand and navigate codebases through the Model Context Protocol. This page covers the MCP-specific implementation, tools, and integration details.
New to CodePrism? See the Introduction for a general overview, or check the Architecture for technical design details.
MCP Integration Featuresโ
๐ Complete MCP Complianceโ
- Resources: Repository files, code symbols, and graph data
- Tools: 20 production-ready code analysis and navigation tools
- Prompts: Code analysis templates and workflow guidance
- Real-time Updates: Live resource and tool updates
๐ Production-Ready Capabilitiesโ
- 100% Tool Success Rate - All 20 tools tested and production-ready
- Semantic Parameter Support - Human-readable names instead of cryptic IDs
- Environment Variable Integration - Automatic repository detection
- Context-Enhanced Responses - Source code snippets included
MCP Server Configurationโ
Server Capabilitiesโ
{
"name": "codeprism-mcp-server",
"version": "0.3.4",
"capabilities": {
"resources": {
"subscribe": true,
"listChanged": true
},
"tools": {
"listChanged": true
},
"prompts": {
"listChanged": false
}
}
}
Transport Protocolโ
- JSON-RPC 2.0 over stdio
- Request/Response Model for tools and resource access
- Structured Error Handling with detailed context
- Real-time Notifications for resource changes
Available Resourcesโ
Repository Resourcesโ
codeprism://repository/- Repository root information and metadatacodeprism://repository/stats- Comprehensive repository statisticscodeprism://repository/config- Configuration and settingscodeprism://repository/tree- Complete file tree structurecodeprism://repository/file/{path}- Individual file content with analysis
Graph & Symbol Resourcesโ
codeprism://graph/repository- Graph structure and statisticscodeprism://symbols/functions- All function symbols in the repositorycodeprism://symbols/classes- All class symbols in the repositorycodeprism://symbols/variables- All variable symbols in the repositorycodeprism://symbols/modules- All module symbols in the repository
Analysis Resourcesโ
codeprism://metrics/quality_dashboard- Code quality metrics and technical debt assessmentcodeprism://architecture/layers- Architectural layer structure identificationcodeprism://architecture/patterns- Detected design patterns and structurescodeprism://architecture/dependencies- High-level dependency analysis
Production Tools (20 Available)โ
Core Navigation & Understanding (4 tools)โ
repository_stats- Get comprehensive statistics about the repositoryexplain_symbol- Provide detailed explanation of a code symbol with contexttrace_path- Find execution paths between two code symbolsfind_dependencies- Analyze dependencies for a code symbol or file
Search & Discovery (4 tools)โ
search_symbols- Search for symbols by name pattern (with regex support)search_content- Search across all content including documentation and commentsfind_files- Find files by name or path patterncontent_stats- Get statistics about indexed content
Advanced Analysis (11 tools)โ
find_unused_code- Graph-based unused code detection with confidence scoringanalyze_security- Advanced vulnerability detection with CVSS scoringanalyze_performance- Performance analysis with time complexity detectionanalyze_api_surface- API surface analysis with versioning complianceanalyze_complexity- Calculate complexity metrics (cyclomatic, maintainability index)trace_data_flow- Bidirectional data flow tracing with transformation trackinganalyze_transitive_dependencies- Complete dependency chain analysis with cycle detectiondetect_patterns- Identify design patterns and architectural structurestrace_inheritance- Python inheritance hierarchy analysis with MRO supportanalyze_decorators- Comprehensive Python decorator analysis with framework detectionfind_duplicates- Duplicate code pattern detection with similarity scoring
Workflow & Orchestration (4 tools)โ
suggest_analysis_workflow- Get intelligent analysis recommendations for specific goalsbatch_analysis- Execute multiple analysis tools in parallel with result aggregationoptimize_workflow- Optimize analysis workflows based on usage patternsfind_references- Find all references to a symbol across the codebase
Available Promptsโ
Repository Overview Promptโ
Name: repository_overview
Description: Generate a comprehensive overview of the repository structure and contents
Arguments:
focus_area(optional): Area to focus on (architecture, dependencies, entry_points, etc.)
Code Analysis Promptโ
Name: code_analysis
Description: Analyze code quality, patterns, and potential improvements
Arguments:
file_pattern(optional): File pattern to focus analysis onanalysis_type(optional): Type of analysis (quality, security, performance, architecture)
Debug Assistance Promptโ
Name: debug_assistance
Description: Help debug issues in the codebase with contextual information
Arguments:
issue_description(required): Description of the issue or erroraffected_files(optional): Files related to the issue
Client Integrationโ
Claude Desktopโ
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"codeprism": {
"command": "codeprism",
"args": ["--mcp"],
"env": {
"CODEPRISM_PROJECT_ROOT": "/path/to/your/project"
}
}
}
}
VS Codeโ
{
"mcp.servers": [
{
"name": "codeprism",
"command": "codeprism",
"args": ["--mcp"],
"workspaceFolder": "${workspaceFolder}"
}
]
}
Cursorโ
{
"mcp.servers": {
"codeprism": {
"command": "codeprism",
"args": ["--mcp", "--project-root", "${workspaceFolder}"]
}
}
}
Usage Patternsโ
Basic Tool Usageโ
// Example tool call via MCP
{
"method": "tools/call",
"params": {
"name": "repository_stats",
"arguments": {
"include_metrics": true
}
}
}
Resource Accessโ
// Example resource access
{
"method": "resources/read",
"params": {
"uri": "codeprism://repository/stats"
}
}
Workflow Optimizationโ
Use the suggest_analysis_workflow tool to get intelligent recommendations for your analysis goals, then use batch_analysis for efficient parallel execution.
Next Stepsโ
- Installation Guide - Set up CodePrism MCP server
- API Reference - Complete tools and capabilities documentation
- Tools Documentation - Detailed tool usage examples
Ready to use CodePrism? Follow the Installation Guide to get started with MCP integration.