Skip to content

Datata1/mycelium

Mycelium Logo

Mycelium

A local, always-fresh repository knowledge base for AI coding agents.

Release SQLite Interfaces


Binary: myco  ·  Storage: SQLite at .mycelium/index.db  ·  Interfaces: MCP, HTTP, CLI

Mycelium parses your repo with Go/AST and tree-sitter, stores symbols and references in a single SQLite file, and serves that index to Claude Code, Cursor, and any other MCP client. A background daemon keeps the index within a few hundred milliseconds of what's on disk. No external services, no Docker.

See CHANGELOG.md for version history and docs/limitations.md for what doesn't work yet.


Install

From release binaries (recommended)

# Linux amd64
curl -sSL https://github.com/datata1/mycelium/releases/latest/download/myco-linux-amd64.tar.gz \
  | tar -xz -C /opt && sudo ln -sf /opt/myco-linux-amd64/myco /usr/local/bin/myco

# macOS arm64 (Apple Silicon)
curl -sSL https://github.com/datata1/mycelium/releases/latest/download/myco-darwin-arm64.tar.gz \
  | tar -xz -C /opt && sudo ln -sf /opt/myco-darwin-arm64/myco /usr/local/bin/myco

Supported platforms: linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, windows/amd64.

From source

Requires Go 1.25+ and a C toolchain (tree-sitter uses cgo).

git clone https://github.com/datata1/mycelium
cd mycelium
task build       # → ~/.local/bin/myco
task install     # → overwrites whichever myco is on PATH

The sqlite_fts5 build tag is required — it enables FTS5 in the embedded SQLite driver.


Quick start

cd my-repo
myco init                          # writes .mycelium.yml, installs post-commit hook
myco daemon &                      # start the watcher + index server
myco query find AuthService        # symbol lookup
myco query refs ParseRequest       # callers
myco query neighbors AuthService --direction in --depth 2

Wire into Claude Code

myco init --mcp claude
# Paste the printed JSON snippet into ~/.claude.json, then restart Claude Code.

Wire into Cursor

myco init --mcp cursor
# Paste the printed JSON snippet into ~/.cursor/mcp.json.

MCP tools

All tools return JSON; line/col positions are 1-based. Tools marked project? accept an optional workspace project name; tools marked since? accept a git ref and restrict to files changed between <ref>...HEAD; tools marked focus? accept the v2.4 lexical filter.

Tool Purpose Key inputs
find_symbol Fuzzy/exact symbol lookup. name, kind?, limit?, project?, since?, focus?
get_references Callers / importers / type uses; resolved vs textual; fans out through interface implementations. target, limit?, project?, since?
read_focused File with non-matching symbols collapsed to one-line markers. Empty focus returns the file in full. path, focus?
search_lexical Ripgrep-style regex over indexed files. pattern, path_contains?, k?, project?, since?
list_files Indexed files with language tags. language?, name_contains?, limit?, project?, since?
get_file_outline Hierarchical symbol tree for one file. path, focus?
get_file_summary Structural summary (exports, imports, LOC). path
get_neighborhood Local call graph around a symbol. Walks RefInherit edges so interface consumers fan in. target, depth?, direction?, project?, focus?
impact_analysis Transitive inbound closure ranked by distance. For "who's impacted if I change this?" target, kind?, depth?, project?, since?
critical_path Up to k shortest outbound call paths from from to to. Bounded BFS at depth ≤ 8. from, to, depth?, k?, project?
stats Languages, symbol counts, refs, freshness.
find_document_key i18n keys, package.json deps, go.mod requires. key, kind?, project?, limit?

Configuration

Edit .mycelium.yml in your repo root (generated by myco init):

version: 1
languages: [go, typescript, python]
include:
  - "**/*.go"
  - "src/**/*.{ts,tsx}"
  - "**/*.py"
exclude:
  - "**/node_modules/**"
  - "**/vendor/**"
watcher:
  debounce_ms: 200
  coalesce_ms: 2000
daemon:
  socket: .mycelium/daemon.sock
  http_port: 7777             # 0 to disable
hooks:
  post_commit: true
index:
  path: .mycelium/index.db
  max_file_size_kb: 1024

Workspace mode

Monorepos with independent sub-projects register each under one daemon — one SQLite file, one watcher, N logical scopes.

projects:
  - name: api
    root: services/api
    languages: [go]
    include: ["**/*.go"]
  - name: web
    root: services/web
    languages: [typescript]
    include: ["**/*.ts", "**/*.tsx"]
  - name: worker
    root: services/worker
    languages: [python]
    include: ["**/*.py"]

Every query tool gains an optional project input that scopes results to one sub-project. Unknown project names return zero hits rather than silently falling back to unscoped.


PR-scoped queries

Pass --since <ref> (CLI) or since (MCP) to restrict any read to files changed between <ref>...HEAD.

myco query files --since main
myco query find Handler --since main
myco query impact MyService --since HEAD~5 --kind method

Adoption: is your agent actually using mycelium?

Enable telemetry in .mycelium.yml:

telemetry:
  enabled: true

Then aggregate after a session:

myco stats --telemetry

See docs/adoption.md for the setup checklist and what healthy adoption looks like.


CLI reference

myco init [--mcp claude|cursor]
myco daemon
myco mcp
myco index
myco stats [--telemetry]
myco doctor

myco query find <name> [--kind K] [--limit N] [--project P] [--since REF] [--focus F]
myco query refs <symbol> [--limit N] [--project P] [--since REF]
myco query files [name-contains] [--language L] [--limit N] [--project P] [--since REF]
myco query outline <path> [--focus F]
myco query summary <path>
myco query neighbors <symbol> [--depth N] [--direction out|in|both] [--project P] [--focus F]
myco query impact <symbol> [--kind K] [--depth N] [--project P] [--since REF]
myco query path <from> <to> [--depth N] [--k N] [--project P]
myco query grep <regex> [--path P] [--k N] [--project P] [--since REF]

Troubleshooting

no such module: fts5 — rebuild with the sqlite_fts5 build tag.

Daemon won't start: listen: address already in use — delete .mycelium/daemon.sock and retry.

myco doctor reports issues — run myco doctor for structured diagnostics. See docs/limitations.md for known constraints.


License

Apache License 2.0 — see LICENSE.

About

A local, always-fresh repository knowledge base for AI coding agents.

Resources

License

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages