KScript docs
EN

AI assistants (MCP)

Setting it up

Install kscript first (Install and editors). Each assistant below starts kscript mcp itself. If one says it can't find kscript, which happens with desktop apps that don't read your shell's PATH, give the full path instead: ~/.kscript/bin/kscript on macOS and Linux (written out, such as /Users/you/.kscript/bin/kscript), or %LOCALAPPDATA%\Programs\kscript\kscript.exe on Windows.

Claude Code

Shell
claude mcp add kscript -- kscript mcp

Add --scope project to save it in the project's .mcp.json, so everyone working on the project gets it:

JSON
{
  "mcpServers": {
    "kscript": { "command": "kscript", "args": ["mcp"] }
  }
}

Claude Desktop

Open Settings → Developer → Edit Config and add the server to claude_desktop_config.json, then restart Claude:

JSON
{
  "mcpServers": {
    "kscript": { "command": "/Users/you/.kscript/bin/kscript", "args": ["mcp"] }
  }
}

Cursor

Add it to .cursor/mcp.json in your project, or to ~/.cursor/mcp.json for every project:

JSON
{
  "mcpServers": {
    "kscript": { "command": "kscript", "args": ["mcp"] }
  }
}

VS Code

In a trusted workspace, the KScript extension automatically provides KScript Docs to agents that use VS Code's MCP servers. Find it under MCP: List Servers in the command palette and enable its tools in the agent's tools picker. The extension uses the same KScript installation as the editor, including kscript.server.path if set. In a Remote SSH workspace, install KScript on the remote host. Each workspace folder gets a server that uses that folder's syntax, lint and format settings.

If you use VS Code without the KScript extension, you can add the server with MCP: Add Server or in .vscode/mcp.json:

JSON
{
  "servers": {
    "kscript": { "type": "stdio", "command": "kscript", "args": ["mcp"] }
  }
}

Windsurf

Add it to ~/.codeium/windsurf/mcp_config.json:

JSON
{
  "mcpServers": {
    "kscript": { "command": "kscript", "args": ["mcp"] }
  }
}

Codex

Shell
codex mcp add kscript -- kscript mcp

Or add it to ~/.codex/config.toml:

toml
[mcp_servers.kscript]
command = "kscript"
args = ["mcp"]

Gemini CLI

Add it to ~/.gemini/settings.json, or .gemini/settings.json in your project:

JSON
{
  "mcpServers": {
    "kscript": { "command": "kscript", "args": ["mcp"] }
  }
}

Other assistants

Most assistants take the same thing: a command, kscript, with the argument mcp. For one that connects to a URL instead, run kscript mcp --http and give it http://localhost:4181/mcp. The HTTP server only listens on localhost and turns away requests from web pages. --port picks another port.