Structural codebase indexer for querying functions, classes, imports, dependency graphs and change impact.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add codebase-index --env PROJECT_ROOT='<PROJECT_ROOT>' -- uvx mcp-codebase-index~/.codex/config.toml
[mcp_servers.codebase-index]
command = "uvx"
args = ["mcp-codebase-index"]
env = { PROJECT_ROOT = "<PROJECT_ROOT>" }
# codex mcp add codebase-index --env PROJECT_ROOT='<PROJECT_ROOT>' -- uvx mcp-codebase-index~/.cursor/mcp.json
{
"mcpServers": {
"codebase-index": {
"command": "uvx",
"args": [
"mcp-codebase-index"
],
"env": {
"PROJECT_ROOT": "<PROJECT_ROOT>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"codebase-index": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-codebase-index"
],
"env": {
"PROJECT_ROOT": "<PROJECT_ROOT>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"codebase-index": {
"command": "uvx",
"args": [
"mcp-codebase-index"
],
"env": {
"PROJECT_ROOT": "<PROJECT_ROOT>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"codebase-index": {
"command": "uvx",
"args": [
"mcp-codebase-index"
],
"env": {
"PROJECT_ROOT": "<PROJECT_ROOT>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"codebase-index": {
"command": "uvx",
"args": [
"mcp-codebase-index"
],
"env": {
"PROJECT_ROOT": "<PROJECT_ROOT>"
}
}
}
}需要的环境变量
PROJECT_ROOT
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。