codesense
a code analyzer mcp server for AI agent
claude mcp add --transport stdio codyrao-codesense-mcp-server docker run -i codesense:latest
How to use
Code Sense is a Go-based MCP server that indexes code from Go, JavaScript, TypeScript, Shell, Python, Java, and C++. It can pull repositories from GitHub, GitLab, or local paths, build an in-memory symbol index, and expose MCP tools for AI-assisted code understanding. The server supports multiple repositories simultaneously, TTL-based automatic cleanup, and an LRU policy to manage resource usage. You can interact with it using the MCP toolset to fetch repositories, search symbols, get file content, and analyze project structure. The available transport methods (stdio, SSE, and streamable) allow you to feed requests and receive responses in a streaming-friendly format suitable for large projects.
How to install
Prerequisites:\n- Go 1.23.8 or higher (for local build and verification)\n- Git access to GitHub/GitLab if using remote repositories\n- Docker installed if you plan to run Code Sense via the provided container image\n\nInstallation steps:\n1) Clone the repository locally (or obtain the source in your environment):\n git clone <repository-url>\n cd code-sense\n\n2) Install Go dependencies (if building locally):\n go mod download\n\n3) Build the server binary (example for local run):\n go build -o code-sense ./cmd/server\n\n4) Run the server directly (local build):\n ./code-sense -repo /path/to/your/project -config config.yaml\n\n5) Optional: run via Docker (using the provided image tag codesense:latest):\n docker pull codesense:latest\n docker run -v /path/to/config.yaml:/app/config.yaml -e MCP_TRANSPORT=stdio codesense:latest\n\n6) If using a pre-built image, ensure you mount your configuration and data directories as needed.\n\nConfigure the server by editing config.yaml as described in the README, including mcp.enabled, codeIndex.projectPath, and GitHub/GitLab access settings.
Additional notes
Tips and caveats:\n- Ensure Go, Git, and network access to GitHub/GitLab are available for repo fetching.\n- TTL defaults to 2 hours and the default max number of repositories is 30; adjust in config.yaml if needed.\n- The MCP toolset includes fetch_repository, create_repo_from_zip, search_symbols, get_file_content, list_all_files, list_all_symbols, get_symbols_by_file, get_project_summary, analyze_code_structure, find_dependencies, get_function_content, and get_variable_definition.\n- For large projects, consider using the Base64 ZIP transfer (create_repo_from_zip) to optimize transmission.\n- If running in Docker, remember to expose the appropriate ports or use the stdio/SSE/streamable transports as your client requires.\n- When indexing multiple languages, the parser backends differ (Go AST for Go; regex/string matching for others). Expect slightly different symbol extraction fidelity across languages.\n- If your repository is private, provide tokens or credentials through the configured token fields in config.yaml or environment variables as supported by your deployment.
Related MCP Servers
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go