Codebrain — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Codebrain (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
CodeBrain(代码知识库大脑)is a local AI assistant that understands your codebase. It uses RAG (Retrieval-Augmented Generation) with a local embedding model and local LLM (Ollama/DeepSeek), exposes an MCP server for external AI tools, and provides a simple Gradio web UI.
sentence-transformerscodebrain_search and codebrain_status tools to Cursor / Claude Code / Clinepip install -r requirements.txtollama pull deepseek-coder:6.7b
ollama serveYou can change the model in config.yaml.
python -m codebrain index /path/to/your/codebaseAdd --watch to monitor file changes:
python -m codebrain index /path/to/your/codebase --watchpython -m codebrain ask "用户登录功能在哪个文件里实现的?"python -m codebrain webOpen http://127.0.0.1:7860.
config.yaml)project:
supported_languages:
- python
- java
- go
- javascript
- typescript
ignore_patterns:
- node_modules
- .git
- __pycache__
- .venv
- venv
- dist
- build
- target
- .idea
- .vscode
- .codebrain
- ".mypy_cache"
- ".pytest_cache"
indexer:
embedding_model: all-MiniLM-L6-v2 # sentence-transformers model
chunk_size: 512
chunk_overlap: 50
vector_store:
provider: chromadb
persist_directory: .codebrain/chroma_db
collection_name: codebrain
llm:
provider: ollama
model: deepseek-coder:6.7b
base_url: http://localhost:11434
temperature: 0.1
max_tokens: 2048
web:
host: 127.0.0.1
port: 7860
mcp:
transport: stdio| Section | Option | Description |
|---|---|---|
project | supported_languages | Languages to index |
project | ignore_patterns | Glob patterns for directories/files to skip |
indexer | embedding_model | HuggingFace sentence-transformers model name |
vector_store | persist_directory | Where ChromaDB stores vectors |
llm | model | Ollama model tag |
llm | base_url | Ollama server URL |
web | host / port | Gradio server bind address |
CodeBrain implements an MCP server over stdio. Tools exposed:
codebrain_search(query, top_k=5, language="") — search the knowledge basecodebrain_status() — show index statisticsAdd to ~/.cursor/mcp.json:
{
"mcpServers": {
"codebrain": {
"command": "python",
"args": ["-m", "codebrain", "mcp"],
"cwd": "/absolute/path/to/codebrain"
}
}
}Add to ~/.claude-code/settings.json:
{
"mcpServers": {
"codebrain": {
"command": "python",
"args": ["-m", "codebrain", "mcp"]
}
}
}Add to Cline MCP settings:
{
"mcpServers": {
"codebrain": {
"command": "python",
"args": ["-m", "codebrain", "mcp"],
"env": {},
"disabled": false,
"autoApprove": ["codebrain_search", "codebrain_status"]
}
}
}python -m codebrain --help
python -m codebrain index <path> [--watch]
python -m codebrain status
python -m codebrain ask "question" [--language python]
python -m codebrain web
python -m codebrain mcpcodebrain/
├── config.py # Configuration loading
├── models.py # CodeChunk / RetrievalResult dataclasses
├── indexer/
│ ├── parser.py # Python AST + regex-based parser for Java/Go/JS/TS
│ ├── embedder.py # sentence-transformers wrapper
│ ├── store.py # ChromaDB wrapper
│ ├── indexer.py # Scan / embed / upsert orchestration
│ └── watcher.py # File-system watcher for incremental updates
├── rag/
│ ├── llm.py # Ollama client
│ └── engine.py # RAG retrieval + generation
├── mcp_server/
│ └── server.py # MCP server implementation
├── web/
│ └── app.py # Gradio chat UI
└── main.py # CLI entry pointask / web / MCP tools..codebrain/chroma_db by default.MIT
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.