MCP Integration

Connect AI clients to Knowns through MCP.

Source fileb4192f7Updated Jun 26, 2026, 7:11 AM

MCP Integration

Knowns exposes an MCP server so AI assistants can access tasks, docs, memory, decisions, templates, time tracking, search, validation, project state, help, and code tools directly.

Server command

bash
knowns mcp --stdio
knowns mcp --stdio --project /path/to/project

If --project is not set, Knowns attempts to auto-detect the project from the current working directory.

Current platform support

PlatformConfig fileScopeAuto setup
Claude Code.mcp.jsonper-projectyes
Kiro.kiro/settings/mcp.jsonper-projectyes
OpenCodeopencode.jsonper-projectyes
Codex.codex/config.tomlper-projectyes
Cursor.cursor/mcp.jsonper-projectyes
Antigravity~/.gemini/antigravity/mcp_config.jsonglobalyes
Claude Desktopapp configglobalmanual

Typical config examples

Claude Code

JSON
{
  "mcpServers": {
    "knowns": {
      "command": "knowns",
      "args": ["mcp", "--stdio"]
    }
  }
}

Cursor

JSON
{
  "mcpServers": {
    "knowns": {
      "command": "knowns",
      "args": ["mcp", "--stdio"]
    }
  }
}

Codex

toml
[mcp_servers.knowns]
command = "knowns"
args = ["mcp", "--stdio"]

OpenCode

JSON
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "knowns": {
      "type": "local",
      "command": ["knowns", "mcp", "--stdio"],
      "enabled": true
    }
  }
}

Important note for global MCP clients

For global MCP configs, the server may not know which project to use at session start if the client starts it outside your repo.

Prefer a project-aware server command when the client supports it:

bash
knowns mcp --stdio --project /path/to/project

Or set the active project with the MCP project tool:

JSON
{ "action": "detect" }
{ "action": "set", "projectRoot": "/path/to/project" }
{ "action": "current" }

Session start

Call initial at the start of every session. It returns:

  • project state (knowledge counts, active timer, LSP status)
  • code intelligence rules (which tools to use for code operations)
  • workflow guidance (tool orchestration patterns)
  • available tools summary

No need to call project({ action: "status" }) separately — initial covers it.

On-demand help

Use help for detailed per-action documentation:

JSON
{ "queries": ["code.find"] }
{ "queries": ["code.*"] }
{ "queries": ["insert"] }

Returns JSON structured as { tool: { action: { when, params, ... } } }.

Why MCP is useful

  • structured AI access to project state
  • less shell parsing and less prompt copy-paste
  • easier validation and retrieval workflows for AI assistants
  • initial + help minimize token overhead while maximizing agent context