@codeatlas/mcp 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +105 -2
- package/dist/mcp-server.js +241 -133
- package/dist/webview-ui/dist/assets/index.css +1 -0
- package/dist/webview-ui/dist/assets/index.js +61 -0
- package/dist/webview-ui/dist/index.html +13 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -113,9 +113,112 @@ After registering, reload your client and the 25 tools appear alongside its buil
|
|
|
113
113
|
|
|
114
114
|
## Self-init: no VS Code required
|
|
115
115
|
|
|
116
|
-
The
|
|
116
|
+
The first time you point it at a workspace, the MCP server indexes the code and starts watching for changes. The AI gets working answers within seconds.
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
Both this server and the VS Code extension can run on the same repo at the same time — they keep their own state, so they don't conflict. Add `.codeatlas-sa/` to `.gitignore` (the index lives there).
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Browser diagrams (`--browser`)
|
|
123
|
+
|
|
124
|
+
Add `--browser` to view the architecture in a browser tab alongside the AI conversation:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npx @codeatlas/mcp /path/to/repo --browser
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
A tab opens at `http://localhost:7742` showing six linked diagram layers: system design, feature clusters, API list, sequences, file dependencies, and function flow. File edits propagate to the browser in real time. Click any node to open the file in your editor.
|
|
131
|
+
|
|
132
|
+
| Flag | Effect |
|
|
133
|
+
|------|--------|
|
|
134
|
+
| `--browser` | Start the diagram view alongside the AI server |
|
|
135
|
+
| `--port <N>` | Use a specific port (default 7742) |
|
|
136
|
+
| `--no-open` | Don't auto-open the browser; just print the URL |
|
|
137
|
+
|
|
138
|
+
Set `CODEATLAS_EDITOR=<cmd>` to pick the editor (defaults to `$EDITOR`, then `code`, `cursor`, `subl`, `nvim`, `vim`).
|
|
139
|
+
|
|
140
|
+
### Connect an LLM
|
|
141
|
+
|
|
142
|
+
AI Review and natural-language search use any OpenAI-compatible provider. Pick one:
|
|
143
|
+
|
|
144
|
+
| Provider | Env var | `provider` setting |
|
|
145
|
+
|----------|---------|--------------------|
|
|
146
|
+
| OpenRouter (default) | `OPENROUTER_API_KEY` | `openrouter` |
|
|
147
|
+
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
148
|
+
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
149
|
+
| Ollama (local — no key) | — | `ollama` |
|
|
150
|
+
| Custom endpoint | `LLM_API_KEY` (optional) | `custom` |
|
|
151
|
+
|
|
152
|
+
Change provider + model from the browser (LLM settings panel) or write to `<workspace>/.codeatlas-sa/config.json`:
|
|
153
|
+
```json
|
|
154
|
+
{
|
|
155
|
+
"codeatlas.llmProvider": "anthropic",
|
|
156
|
+
"codeatlas.llmModel": "claude-3-5-sonnet-latest"
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Compare commits, branches, and pull requests
|
|
161
|
+
|
|
162
|
+
From the diagram view in your browser:
|
|
163
|
+
|
|
164
|
+
- **Compare Commits** — pick base + head from a list of recent commits.
|
|
165
|
+
- **Compare Branch** — pick a branch; the diff shows what that branch added relative to your current `HEAD`.
|
|
166
|
+
- **Compare PR** — pick a pull request from the connected GitHub repo. Public repos work without a token (60 requests/hour limit). For private repos or higher rate limits, set `GITHUB_TOKEN` (or `GH_TOKEN`) with at least `repo` scope.
|
|
167
|
+
|
|
168
|
+
### Pairing with your AI assistant
|
|
169
|
+
|
|
170
|
+
The AI doesn't open the browser — you do. Register the server with `--browser` and the AI can cite URLs you click to jump straight to a specific diagram.
|
|
171
|
+
|
|
172
|
+
**Claude Code:**
|
|
173
|
+
```bash
|
|
174
|
+
claude mcp add codeatlas -- npx -y @codeatlas/mcp $(pwd) --browser
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Cursor / VS Code / Codex / Gemini** — add `--browser` to the args:
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"mcpServers": {
|
|
181
|
+
"codeatlas": {
|
|
182
|
+
"command": "npx",
|
|
183
|
+
"args": ["-y", "@codeatlas/mcp", "/absolute/path/to/repo", "--browser"]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
The AI can link directly to any layer:
|
|
190
|
+
|
|
191
|
+
| URL | View |
|
|
192
|
+
|------|------|
|
|
193
|
+
| `http://localhost:7742/` | System design |
|
|
194
|
+
| `http://localhost:7742/#/features/service:main` | Feature clusters |
|
|
195
|
+
| `http://localhost:7742/#/apis/cluster:auth` | APIs in a cluster |
|
|
196
|
+
| `http://localhost:7742/#/sequence/<file>:<handler>` | Sequence for a route |
|
|
197
|
+
| `http://localhost:7742/#/file/<path>` | File diagram |
|
|
198
|
+
| `http://localhost:7742/#/flow/<path>/<fn>` | Function flow |
|
|
199
|
+
|
|
200
|
+
### If port 7742 is already in use
|
|
201
|
+
|
|
202
|
+
The server tries 7742 first and walks up (7743, 7744, …) up to four times if those are busy. The actual port appears in the startup log:
|
|
203
|
+
|
|
204
|
+
```
|
|
205
|
+
CodeAtlas browser ready: http://localhost:7743
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
To pick a specific port, pass `--port`:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npx @codeatlas/mcp /path/to/repo --browser --port 8080
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Restarting the server
|
|
215
|
+
|
|
216
|
+
The standalone is a single process. To restart:
|
|
217
|
+
|
|
218
|
+
- **Launched in a terminal:** press `Ctrl+C`, then re-run the command.
|
|
219
|
+
- **Launched by an AI client** (Claude Code, Cursor, etc.): use the client's "reload MCP servers" action, or quit and reopen the client.
|
|
220
|
+
|
|
221
|
+
After restart the browser reconnects automatically — just refresh the tab.
|
|
119
222
|
|
|
120
223
|
---
|
|
121
224
|
|