
How to add LLM Context to Windsurf
Smart context management for LLM workflows — rule-based file selection shared via MCP or clipboard. Paste the config into ~/.codeium/windsurf/mcp_config.json and restart Windsurf.
Last updated June 14, 2026 · 301★ · stdio · no auth
Windsurf config for LLM Context
uv tool install "llm-context>=0.6.0"{
"mcpServers": {
"llm-context": {
"command": "uvx",
"args": [
"--from",
"llm-context",
"lc-mcp"
]
}
}
}Requires `uv` (the Python package runner). Install it from https://docs.astral.sh/uv/ if `uvx` is not found.
Setup steps
- 1Open Windsurf → Cascade → the hammer/MCP icon → Configure (or edit ~/.codeium/windsurf/mcp_config.json).
- 2Paste the LLM Context config below.
- 3Fill in placeholder secrets, then save.
- 4Click Refresh in the MCP panel.
- 5LLM Context's tools become available to Cascade.
Before you start
- uv / uvx installed (used to install and run the lc-* commands and the MCP server)
- A project initialized with lc-init (creates .llm-context/)
What LLM Context can do in Windsurf
lc_outlinesGenerate excerpted context (code structure outlines) from the current rule.
lc_previewValidate a rule's effectiveness — check file selection and context size before use.
lc_missingFetch specific files or implementations on demand (by param_type and data, with a timestamp).
Security
The server exposes filesystem read access (file selection, outlines, and on-demand file fetching) scoped to the project root path you provide. It runs locally over stdio with no authentication; only grant it access to projects you intend the AI to read.
LLM Context + Windsurf FAQ
Where is the Windsurf config file?
Windsurf reads MCP servers from ~/.codeium/windsurf/mcp_config.json. Paste the LLM Context config there under the "mcpServers" key and restart the client.
Is LLM Context safe to use with Windsurf?
The server exposes filesystem read access (file selection, outlines, and on-demand file fetching) scoped to the project root path you provide. It runs locally over stdio with no authentication; only grant it access to projects you intend the AI to read.
Do I need the MCP server, or can I just use the clipboard?
Both work. The clipboard workflow (lc-select / lc-context) requires no server. The MCP integration (lc-mcp) is recommended so the AI can fetch additional files during a conversation without manual copying.
How do I add it to Claude Desktop?
Add an mcpServers entry to claude_desktop_config.json with command "uvx" and args ["--from", "llm-context", "lc-mcp"], then restart Claude Desktop.
What are rules?
Rules are YAML+Markdown files describing what context to provide for a task. They come in five categories (prm-, flt-, ins-, sty-, exc-) and can be composed from simpler reusable rules.