MCP server for code retrieval from a fully indexed codebase using CocoIndex
Project description
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
{
"mcpServers": {
"codebase-rag": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DATABASE_URL",
"-e",
"VOYAGE_API_KEY",
"-e",
"EMBEDDING_TABLE",
"-e",
"TRACKING_TABLE",
"-p",
"8080:8080",
"allentcm/mcp-codebase-rag:1.0.0"
],
"env": {
"DATABASE_URL": "postgres://cocoindex:cocoindex@localhost/cocoindex",
"VOYAGE_API_KEY": "voyage_api_key",
"EMBEDDING_TABLE": "codebase__code_embeddings",
"TRACKING_TABLE": "codebase__cocoindex_tracking"
}
}
}
}
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_mcp_codebase_rag-1.0.0.tar.gz.
File metadata
- Download URL: iflow_mcp_mcp_codebase_rag-1.0.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45ab6ee7243347a0d0bda89ef5a996b62d8bb64fbcee3c06a5caa80e411a771a
|
|
| MD5 |
a2a4ff06708915bd0da36cab38d6c083
|
|
| BLAKE2b-256 |
bf9c07010437c8b57e617ff324f61195e2c0c99b6405a98804f355b317761042
|
File details
Details for the file iflow_mcp_mcp_codebase_rag-1.0.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_mcp_codebase_rag-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2861d37d917f61dc70bf70ab54f5574e61886bbc1e75b850c7cf34536e29e45a
|
|
| MD5 |
8225e91c4b2973eb6faaec59b49c093a
|
|
| BLAKE2b-256 |
ee8f6b7def907bb4769033bb0f7bbd06e333c156a96ea9ac456e91ba83e33eea
|