Uses PostgreSQL database to store and query code embeddings for semantic codebase search, enabling vector similarity searches across tracked code snippets and files.
Codebase RAG MCP Server
This MCP server provides semantic codebase search and file retrieval using embeddings and a PostgreSQL database. It exposes tools for searching code, listing files, and retrieving file contents.
Features
- Semantic Code Search: Uses Voyage embedding model to convert queries into vectors and search code snippets by similarity.
- File Listing: Lists all tracked files in the codebase.
- File Content Retrieval: Fetches the full content of a file by filename.
Tools
- search_codebase
- Returns code snippets relevant to the query.
- Inputs:
query
(string): Search terms
- get_files
- Lists all files in the codebase.
- get_file_content
- Returns the content of the specified file.
- Inputs:
filename
(string): Filename
Configuration
Getting a Voyage API Key
- Sign up for a Voyage API account
- Generate your API key from the dashboard
Environment Variables
DATABASE_URL
: PostgreSQL connection string.VOYAGE_API_KEY
: API key for embedding model.EMBEDDING_TABLE
: Table name for code embeddings.TRACKING_TABLE
: Table name for file tracking.
Docker
License
This MCP server is licensed under the MIT License. You are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables semantic search and retrieval of code files using embeddings stored in PostgreSQL. Supports intelligent codebase exploration through natural language queries, file listing, and content retrieval.