You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Client calls tools (`get_data_sources` → `semantic_search` / `grep_search`→ `fetch_artifacts` / `get_artifact_relationships` → `chat` only if synthesis is still needed)
4. Tool translates MCP call to CodeAlive API request (with `X-CodeAlive-*` headers)
120
120
5. Response parsed, formatted as XML or text, returned to AI client
@@ -144,7 +144,7 @@ The server is designed to integrate with:
144
144
- Any MCP-compatible AI client
145
145
146
146
Key integration considerations:
147
-
- AI clients should use `get_data_sources` first to discover available repositories/workspaces, then use those IDs for targeted search and chat operations
147
+
- AI clients should use `get_data_sources` first to discover available repositories/workspaces, then default to `semantic_search` and `grep_search`for evidence gathering; use `chat` only as a slower synthesis fallback
148
148
-**n8n Integration**: The server includes middleware to automatically strip n8n's extra parameters (sessionId, action, chatInput, toolCallId) from tool calls, so n8n works out of the box without any special configuration
149
149
150
150
## Logging Best Practices
@@ -157,7 +157,7 @@ This project uses **loguru** for structured JSON logging. All logs go to **stder
157
157
158
158
2.**All logs go to stderr.** The stdio MCP transport uses stdout for protocol messages. Any stray `print()` or stdout write will corrupt the MCP protocol and break the client. If you add a new log sink, it must target `sys.stderr`.
159
159
160
-
3.**Never call `response.text` without a debug guard.**`log_api_response()` is protected by `_is_debug_enabled()` because reading `response.text` consumes the response body. The `codebase_consultant` tool streams SSE via `response.aiter_lines()` — calling `.text` first would silently consume the stream and produce empty results. If you add new response logging, always check `_is_debug_enabled()` first:
160
+
3.**Never call `response.text` without a debug guard.**`log_api_response()` is protected by `_is_debug_enabled()` because reading `response.text` consumes the response body. The `chat` tool and deprecated `codebase_consultant` alias stream SSE via `response.aiter_lines()` — calling `.text` first would silently consume the stream and produce empty results. If you add new response logging, always check `_is_debug_enabled()` first:
161
161
```python
162
162
ifnot _is_debug_enabled():
163
163
return# Do NOT touch response body at INFO level
@@ -269,7 +269,7 @@ Key points:
269
269
- Custom lifespan yields a real `CodeAliveContext` with a mock-backed httpx client
270
270
-`monkeypatch.setenv("CODEALIVE_API_KEY", ...)` for `get_api_key_from_context` fallback
271
271
- Use `raise_on_error=False` when testing error paths, then assert on `result.content[0].text`
272
-
- For SSE streaming (codebase_consultant), return `httpx.Response(200, text=sse_body)` — `aiter_lines()` works on buffered responses
272
+
- For SSE streaming (`chat` / `codebase_consultant`), return `httpx.Response(200, text=sse_body)` — `aiter_lines()` works on buffered responses
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,8 +30,9 @@ Once connected, you'll have access to these powerful tools:
30
30
3.**`grep_search`** - Exact text or regex search with line-level matches
31
31
4.**`fetch_artifacts`** - Load the full source for relevant search hits
32
32
5.**`get_artifact_relationships`** - Expand call graph, inheritance, and reference relationships for one artifact
33
-
6.**`codebase_consultant`** - AI consultant with full project expertise
33
+
6.**`chat`** - Slower synthesized codebase Q&A, typically only after search
34
34
7.**`codebase_search`** - Deprecated legacy semantic search alias kept for backward compatibility
35
+
8.**`codebase_consultant`** - Deprecated alias for `chat`
35
36
36
37
## 🎯 Usage Examples
37
38
@@ -40,7 +41,9 @@ After setup, try these commands with your AI assistant:
40
41
-*"Show me all available repositories"* → Uses `get_data_sources`
41
42
-*"Find authentication code in the user service"* → Uses `semantic_search`
42
43
-*"Find the exact regex that matches JWT tokens"* → Uses `grep_search`
43
-
-*"Explain how the payment flow works in this codebase"* → Uses `codebase_consultant`
44
+
-*"Explain how the payment flow works in this codebase"* → Usually starts with `semantic_search`/`grep_search`, then optionally uses `chat`
45
+
46
+
`semantic_search` and `grep_search` should be the default tools for most agents. `chat` is a slower synthesis fallback, can take up to 30 seconds, and is usually unnecessary when an agent can run a multi-step workflow with search, fetch, relationships, and local file reads. If your agent supports subagents, the highest-confidence path is to delegate a focused subagent that orchestrates `semantic_search` and `grep_search` first.
44
47
45
48
## 📚 Agent Skill
46
49
@@ -808,8 +811,9 @@ See [JetBrains MCP Documentation](https://www.jetbrains.com/help/ai-assistant/mc
808
811
- `semantic_search`- Search code semantically
809
812
- `grep_search`- Search by exact text or regex
810
813
- `get_artifact_relationships`- Expand relationships for one artifact
814
+
- `chat`- Slower synthesized codebase Q&A, usually after search
811
815
- `codebase_search`- Legacy semantic search alias
812
-
- `codebase_consultant`- Ask questions about code
816
+
- `codebase_consultant`- Deprecated alias for `chat`
Copy file name to clipboardExpand all lines: manifest.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -65,13 +65,17 @@
65
65
"name": "grep_search",
66
66
"description": "Search indexed artifacts by exact text or regex and return line-level matches."
67
67
},
68
+
{
69
+
"name": "chat",
70
+
"description": "Synthesized codebase Q&A. Slower and usually not the default choice; prefer semantic_search and grep_search first. Can take up to 30 seconds."
71
+
},
68
72
{
69
73
"name": "fetch_artifacts",
70
74
"description": "Fetch full source for specific search results when you need the underlying code."
71
75
},
72
76
{
73
77
"name": "codebase_consultant",
74
-
"description": "Ask architecture and implementation questions with full codebase context."
78
+
"description": "Deprecated alias for chat kept for backward compatibility."
Copy file name to clipboardExpand all lines: server.json
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -66,9 +66,13 @@
66
66
"name": "grep_search",
67
67
"description": "Search indexed artifacts using exact text or regex patterns and return line-level matches."
68
68
},
69
+
{
70
+
"name": "chat",
71
+
"description": "Synthesized codebase Q&A. Use only after semantic_search and grep_search when you need a slower, up-to-30-second answer."
72
+
},
69
73
{
70
74
"name": "codebase_consultant",
71
-
"description": "Get comprehensive AI-powered analysis, explanations, and insights about your codebase. Ask complex questions about architecture, patterns, dependencies, and implementation details."
75
+
"description": "Deprecated alias for chat retained for backward compatibility."
0 commit comments