1.0.11 • Published 5 months ago

mcp-server-code-mapper v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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-mapper

Usage

Basic Usage

# Start the MCP server
mcp-server-code-mapper

# Or use the cursor-test version with enhanced logging
mcp-server-code-mapper-cursor-test

Integration with Cursor

To use this MCP server with Cursor:

  1. Open Cursor
  2. Go to Settings > Extensions > MCP
  3. Add a new MCP server with the command:
    npx mcp-server-code-mapper-cursor-test@latest
  4. Name it "Code Mapper"
  5. 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:

  1. cursor-test-debug.log: Detailed debug logs for troubleshooting
  2. cursor-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 events
  • ENV: Environment information
  • REQUEST: Incoming requests
  • METHOD: Method processing
  • RESPONSE: Outgoing responses
  • ERROR: Error information
  • TOOL: Tool execution details
  • RESOURCE: Resource handling
  • CRITICAL: Critical errors
  • SIGNAL: Process signals
  • SHUTDOWN: Server shutdown events
  • HEARTBEAT: Regular server heartbeats

Troubleshooting

If you encounter issues with the MCP server:

  1. Check the log files in your current working directory
  2. Ensure you're using the latest version
  3. Verify your Cursor configuration is correct
  4. 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 test

License

MIT

1.0.11

5 months ago

1.0.10

5 months ago

1.0.9

5 months ago

1.0.8

5 months ago

1.0.7

5 months ago

1.0.6

5 months ago

1.0.5

5 months ago

1.0.4

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago