mcp-server-code-mapper
v1.0.11
Published
MCP server for code mapping and analysis
Readme
MCP Server for Code Mapper
A Model Context Protocol (MCP) server implementation for the Code Mapper tool, designed to analyze TypeScript/React project structures.
Features
- Implements the MCP protocol for integration with Cursor and other MCP-compatible clients
- Provides tools for analyzing project structure and generating reports
- Enhanced logging for debugging and monitoring
- JSON-RPC 2.0 compliant API
Installation
# Install globally
npm install -g mcp-server-code-mapper
# Or run directly with npx
npx mcp-server-code-mapperUsage
Basic Usage
# Start the MCP server
mcp-server-code-mapper
# Or use the cursor-test version with enhanced logging
mcp-server-code-mapper-cursor-testIntegration with Cursor
To use this MCP server with Cursor:
- Open Cursor
- Go to Settings > Extensions > MCP
- Add a new MCP server with the command:
npx mcp-server-code-mapper-cursor-test@latest - Name it "Code Mapper"
- Save and activate the server
Available Tools
analyze_project
Analyzes the project structure and generates a report.
Parameters:
include: Comma-separated list of glob patterns to include (e.g., "src//*.{ts,tsx},functions//*.{ts,tsx}")exclude: Comma-separated list of glob patterns to exclude (e.g., "/node_modules/,/dist/")output: Path to save the report (default: code-mapper-report.json)verbose: Enable verbose logging
check_report
Checks a report for issues.
Parameters:
report: Path to the report file (default: code-mapper-report.json)error_threshold: Maximum number of errors allowed (default: 0)warning_threshold: Maximum number of warnings allowed (default: 10)
Enhanced Logging
The cursor-test.js script provides enhanced logging capabilities:
Log Files
When running mcp-server-code-mapper-cursor-test, two log files are created in the current working directory:
cursor-test-debug.log: Detailed debug logs for troubleshootingcursor-mcp.log: Structured, human-readable logs for monitoring
Log Format
The cursor-mcp.log file uses a structured format:
[TIMESTAMP] [LOG_TYPE] Message
{
"json": "data if available"
}
--------------------------------------------------------------------------------Log Types
STARTUP: Server initialization eventsENV: Environment informationREQUEST: Incoming requestsMETHOD: Method processingRESPONSE: Outgoing responsesERROR: Error informationTOOL: Tool execution detailsRESOURCE: Resource handlingCRITICAL: Critical errorsSIGNAL: Process signalsSHUTDOWN: Server shutdown eventsHEARTBEAT: Regular server heartbeats
Troubleshooting
If you encounter issues with the MCP server:
- Check the log files in your current working directory
- Ensure you're using the latest version
- Verify your Cursor configuration is correct
- Check for any error messages in the logs
Development
To contribute to this project:
# Clone the repository
git clone https://github.com/derekzar/mcp-server-code-mapper.git
# Install dependencies
cd mcp-server-code-mapper
npm install
# Run the server
npm start
# Test the cursor version
npm testLicense
MIT
