Skip to content

MCP Server Integration

Nick Kwiatkowski edited this page Nov 25, 2026 · 1 revision

MCP Server Integration

clif mcp is a Model Context Protocol server on stdio. Register it with an MCP client (Claude Desktop, Claude Code, Cursor, VS Code, Zed, …) and the assistant can ask about the CFML workspace through typed tools instead of grepping files.

Command-line flags are covered in Using the MCP server; every tool, resource and prompt is documented in Available MCP Actions.

Protocol summary

Property Value
Transport stdio, newline-delimited JSON-RPC 2.0 (stdout is the protocol; logs go to stderr)
Protocol version 2025-06-18 (clients requesting another revision are still served)
Capabilities tools, resources, prompts (all listChanged: false)
Methods initialize, ping, tools/list, tools/call, resources/list, resources/read, prompts/list, prompts/get
Server info { "name": "clif", "version": "<clif version>" }, plus an instructions string describing the tools
Tool annotations Every tool is readOnlyHint: true, destructiveHint: false, idempotentHint: true; lint adds openWorldHint: true (it starts CFLint)
Tool errors Returned as a normal result with isError: true and the message as text, so the model can read and act on it
Tool results content[0].text (pretty-printed JSON) and structuredContent (the same object)

Registering the server

The server resolves relative paths against its working directory and confines every path to the workspace root, so always start it in (or point --root at) the project.

Generic mcpServers configuration

Used by Claude Desktop (claude_desktop_config.json), Cursor (.cursor/mcp.json) and many others:

{
  "mcpServers": {
    "clif": {
      "command": "clif",
      "args": ["mcp", "--allow-lint"],
      "cwd": "/path/to/project"
    }
  }
}

If a client has no cwd setting, pass the root explicitly:

{
  "mcpServers": {
    "clif": { "command": "clif", "args": ["mcp", "--root", "/path/to/project"] }
  }
}

Claude Code

cd /path/to/project
claude mcp add clif -- clif mcp --allow-lint

VS Code (.vscode/mcp.json)

{
  "servers": {
    "clif": {
      "type": "stdio",
      "command": "clif",
      "args": ["mcp", "--root", "${workspaceFolder}"]
    }
  }
}

Zed (settings.json)

{
  "context_servers": {
    "clif": {
      "command": { "path": "clif", "args": ["mcp", "--root", "/path/to/project"] }
    }
  }
}

Windows

Use the full path to clif.exe if it is not on the PATH the client sees:

{
  "mcpServers": {
    "clif": {
      "command": "C:\\Users\\me\\AppData\\Local\\clif\\bin\\clif.exe",
      "args": ["mcp", "--root", "C:\\projects\\myapp"]
    }
  }
}

Client config formats change between releases. The command/args pair above is what matters; check your client's documentation for where it goes.

Choosing a configuration

Goal args Tools offered
Source checks only (default) ["mcp"] explore, find_unresolved_calls, find_references, explain_call, get_outline, get_type_hierarchy, lookup_docs, check_structure, resolve_route, check_format
Add CFLint ["mcp", "--allow-lint"] The above + lint
Add the code map ["mcp", "--db", ".clif/codemap.db"] The above + search_symbols, get_symbol, get_callers, get_callees, find_path, impact_analysis, list_islands, list_orphans, get_stats
Code map, kept current ["mcp", "--db", ".clif/codemap.db", "--watch"] Same; the map is rebuilt incrementally as files change
Map only, never read source ["mcp", "--db", ".clif/codemap.db", "--map-only"] Map tools only
Small-context model ["mcp", "--tools", "slim"] explore, find_unresolved_calls, explain_call
Share the editor's index ["mcp", "--daemon"] Default set, answered from the running LSP daemon (falls back to a local index)

Build the map once before using --db:

clif graph --db .clif/codemap.db .

CLIF_MCP_TOOLS in the client's environment does the same as --tools:

{
  "mcpServers": {
    "clif": {
      "command": "clif",
      "args": ["mcp"],
      "cwd": "/path/to/project",
      "env": { "CLIF_MCP_TOOLS": "explore,find_unresolved_calls,find_references,get_outline" }
    }
  }
}

A session on the wire

Request:

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"demo","version":"0"}}}

Response (abridged):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-06-18",
    "capabilities": {
      "tools": { "listChanged": false },
      "resources": { "listChanged": false },
      "prompts": { "listChanged": false }
    },
    "serverInfo": { "name": "clif", "version": "0.7.7" },
    "instructions": "Read-only CFML workspace tools: find_unresolved_calls reports calls that do not resolve and explain_call says why one did or did not; …"
  }
}

A tool call:

{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"explain_call","arguments":{"file":"handlers/Main.cfc","line":31}}}

A tool error (note: a successful JSON-RPC response):

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [{ "type": "text", "text": "get_callers needs a code map, and this server was started without one: build it with `clif graph --db <file> <dir>` and start the server with --db <file>" }],
    "isError": true
  }
}

Security notes

Property Detail
Writes None. Only --watch updates the --db file
Path confinement Every path must resolve inside the workspace root after following symlinks
Process launch Only lint (with --allow-lint) starts another process: CFLint
Prompt arguments Rejected when longer than 512 bytes or containing control characters (newlines included), so a value cannot inject lines into a prompt

← Integrator Documentation · Home

Clone this wiki locally