Skip to content

feat(mcp): import servers from .mcp.json, .claude.json, .cursor/mcp.json - #47

Merged
Prateekgaur merged 1 commit into
KlaatAI:mainfrom
syf2211:feat/compat-import-mcp-configs
Jul 23, 2026
Merged

feat(mcp): import servers from .mcp.json, .claude.json, .cursor/mcp.json#47
Prateekgaur merged 1 commit into
KlaatAI:mainfrom
syf2211:feat/compat-import-mcp-configs

Conversation

@syf2211

@syf2211 syf2211 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Import MCP server definitions from existing tool configs so users can try KlaatCode without reconfiguring servers.

Motivation

Fixes #36

Many developers already maintain MCP configs for Claude Code or Cursor. Reading those files makes onboarding zero-setup.

Changes

  • Add src/mcp/import.ts to parse external mcpServers entries (stdio + HTTP/SSE)
  • Expand env refs: ${VAR}, ${VAR:-default}, ${env:VAR}, ${workspaceFolder}, ${userHome}
  • Merge precedence: .klaatai/mcp.json > ~/.klaatai/mcp.json > .mcp.json > .claude.json > .cursor/mcp.json
  • Gate behind compat.importMcpConfigs (default on)
  • Startup stderr logs per import/override; /mcp shows source file
  • Fix /mcp disable to respect source (don't edit home config when server came from project/import)
  • README + config docs for compat.importMcpConfigs

Tests

bun run typecheck   # pass
bun test            # 236 passed (11 new in src/mcp/import.test.ts)
bun run build       # pass

Notes

  • composer-2.5 review: APPROVE after disable fix
  • Cursor-only fields (auth, envFile) are ignored (no native equivalent yet)
  • Native .klaatai/mcp.json entries are not env-expanded (existing behavior)

Fixes KlaatAI#36

- Add external MCP config import with precedence merge
- Expand ${VAR}, ${env:VAR}, ${workspaceFolder}, ${userHome}
- Gate behind compat.importMcpConfigs (default on)
- Show source in /mcp; fix disable for non-home configs
- Add fixture-based unit tests
@Prateekgaur
Prateekgaur merged commit 3017077 into KlaatAI:main Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compat: import MCP servers from .mcp.json / .claude.json / .cursor/mcp.json

2 participants