Repository navigation
Using the MCP server
clif mcp serves a CFML workspace over the Model Context Protocol on
stdio, so an AI assistant can ask about the code (unresolved calls, references, outlines, call graphs)
instead of grepping for it. It writes nothing unless --watch is set, which updates the code-map
database.
This page covers running it from the command line. Registering it with a client is covered in MCP Server Integration, and every tool's parameters in Available MCP Actions.
clif mcp [--db <file>] [--watch] [--root <dir>] [--tools <list>] [--daemon] [--daemon-socket <path>]
[--allow-lint] [--map-only] [--no-explain]
| Option | Description |
|---|---|
--db <file> |
Load the code map that clif graph --db built, adding the map tools |
--watch |
Keep the --db map in sync in the background as CFML files change on disk (debounced incremental rebuild). Requires --db
|
--root <dir> |
Workspace root: explain_call indexes it, and every tool's paths must lie inside it. Default: the map's own root, or the working directory without a map |
--tools <list> |
Comma-separated allowlist of tools to advertise, or slim for explore,find_unresolved_calls,explain_call. Also read from CLIF_MCP_TOOLS
|
--daemon |
Connect to a running clif LSP daemon for this workspace so MCP shares its live index. Falls back to a local index if the daemon is down |
--daemon-socket <path> |
Explicit Unix socket path for --daemon (implies --daemon) |
--allow-lint |
Offer the lint tool (starts a CFLint process) |
--map-only |
Offer only the map tools and never read source. Requires --db; cannot be combined with --allow-lint
|
--no-explain |
Do not offer explain_call
|
| Started with | Tools |
|---|---|
| (no flags) |
explore, find_unresolved_calls, find_references, explain_call, get_outline, get_type_hierarchy, lookup_docs, check_structure, resolve_route, check_format
|
--db <file> |
All of the above, plus search_symbols, get_symbol, get_callers, get_callees, find_path, impact_analysis, list_islands, list_orphans, get_stats
|
--db <file> --map-only |
Only the map tools (and explore) |
--allow-lint |
Adds lint
|
--no-explain |
Removes explain_call
|
--tools slim |
Only explore, find_unresolved_calls, explain_call
|
Source tools only, run from the project root:
cd ~/projects/myapp
clif mcp
# stderr: clif MCP server on stdio (no code map)With a code map that stays current:
clif graph --db .clif/codemap.db .
clif mcp --db .clif/codemap.db --watch
# stderr: clif MCP server on stdio (db: .clif/codemap.db)A minimal tool set for a small-context model:
clif mcp --tools slim
CLIF_MCP_TOOLS=explore,find_references,get_outline clif mcpShare the editor's live index:
clif mcp --daemon
# stderr: clif MCP server connected to daemon (<socket path>)
# or, when no daemon is running:
# stderr: clif mcp --daemon: <reason> (falling back to local workspace index)The protocol is newline-delimited JSON-RPC on stdin/stdout. Diagnostics go to stderr; stdout is reserved for the protocol.
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"test","version":"0"}}}' \
'{"jsonrpc":"2.0","method":"notifications/initialized"}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \
'{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_outline","arguments":{"file":"models/User.cfc"}}}' \
| clif mcp| Rule | Detail |
|---|---|
| Relative paths | Resolved against the server's working directory |
| Confinement | Every path must lie inside the workspace root (--root, the map's root, or the working directory) after symlinks
|
| Configuration | The .clif.json above the first path a tool is given decides how calls resolve |
| List sizes | Capped (200 by default for most tools), with the total alongside |
Read get_stats before trusting an empty caller list. The resolved/unresolved ratio is the map's
confidence in itself: a call the resolver could not follow is an edge the map does not have. On a workspace
resolving half its call sites, "nothing calls this" means much less than it seems, which is why
list_orphans returns candidates, not dead code.