Skip to content

Commit 4c5a75c

Browse files
Merge pull request #48 from CodeAnt-AI/pranav/mcp-read-only-fixes
Fix MCP server concurrency, login, and oversized results (0.5.10)
2 parents 87157e2 + 831604f commit 4c5a75c

13 files changed

Lines changed: 767 additions & 148 deletions

File tree

‎.claude-plugin/marketplace.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66
},
77
"metadata": {
88
"description": "CodeAnt AI CLI and MCP server — org-wide secret triage, cross-repo SAST/SCA findings, on-demand scans, and local PR review inside Claude.",
9-
"version": "0.4.14"
9+
"version": "0.5.10"
1010
},
1111
"plugins": [
1212
{
1313
"name": "codeant",
14-
"source": "./.",
15-
"description": "Drive CodeAnt AI from inside Claude Code via the CodeAnt MCP server. Read-only by default; write tools (trigger scan, resolve PR thread) gated behind CODEANT_READ_ONLY=0.",
16-
"version": "0.4.14",
14+
"source": "./",
15+
"description": "Drive CodeAnt AI from inside Claude Code via the CodeAnt MCP server. Read-only by default; write tools (trigger scan, resolve PR thread, write API requests) gated behind CODEANT_READ_ONLY=0.",
16+
"version": "0.5.10",
1717
"author": {
1818
"name": "CodeAnt AI",
1919
"email": "support@codeant.ai"
2020
},
21-
"homepage": "https://docs.codeant.ai/cli/claude-code-integration",
21+
"homepage": "https://docs.codeant.ai/cli/mcp-server",
2222
"license": "MIT",
2323
"keywords": [
2424
"code-review",

‎.claude-plugin/plugin.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "codeant",
3-
"version": "0.4.14",
3+
"version": "0.5.10",
44
"description": "CodeAnt AI MCP server inside Claude Code — org-wide secret triage, cross-repo SAST/SCA findings, on-demand scans, and local PR review.",
55
"author": {
66
"name": "CodeAnt AI",
77
"email": "support@codeant.ai"
88
},
9-
"homepage": "https://docs.codeant.ai/cli/claude-code-integration",
10-
"documentation": "https://docs.codeant.ai/cli/claude-code-integration",
9+
"homepage": "https://docs.codeant.ai/cli/mcp-server",
10+
"documentation": "https://docs.codeant.ai/cli/mcp-server",
1111
"license": "MIT",
1212
"keywords": [
1313
"code-review",

‎changelog.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [0.5.10] - 03/10/2026
4+
- MCP: parallel `codeant_scans_results` calls no longer swallow other tool responses, leak findings onto the protocol stream, or hang the server
5+
- MCP: `codeant_login` returns the sign-in link right away and finishes in the background (call it again to confirm); a missing browser launcher no longer crashes the server
6+
- MCP: the saved token is read on every request, so `codeant login` / `codeant logout` in a terminal take effect without restarting the server
7+
- MCP: `codeant_review_local` reports failures (for example, no git repository) as errors instead of an empty issue list
8+
- MCP: smaller results — compact JSON, slim and paged `codeant_scans_repos`, `codeant_pentest_history`, and cloud scan history, paged CSPM findings without compliance mappings, smaller default page sizes, and a size limit (`CODEANT_MCP_MAX_RESULT_CHARS`, default 80000) that refuses oversized results with a hint
9+
- MCP: the server sends instructions that tell agents how to discover, page, and recover authentication (including `force: true` when a configured token is rejected)
10+
- MCP: concurrent `codeant_login` calls share one sign-in; `codeant_cloud_scan_history` pages with `offset`
11+
- MCP: removed pull request tool parameters that no provider applied (`defaultBranch`, `codeant_pr_comments` `addressed`, `codeant_comments_search` `includeAddressed` and `createdAfter`) and corrected the `codeant_pr_get`, `codeant_pr_comments`, `codeant_comments_search`, and `codeant_api_get` descriptions
12+
- MCPB: added Dashboard URL and Disable telemetry settings, and listed `codeant_scans_overrides`
13+
- The Azure DevOps "org URL not found" error now names `AZURE_DEVOPS_ORG_URL` instead of a command that does not exist
14+
315
## [0.5.9] - 02/10/2026
416
- Added `duplicate_code` to `scans results` / `findings repo`
517
- Dismissed and false-positive flags are kept on IaC and dead-code findings, and shown as `metadata.dismissed` / `metadata.false_positive`

‎mcp.md‎

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The CodeAnt CLI ships an MCP (Model Context Protocol) server that exposes CodeAn
1111
| Name | Read/Write | What it does |
1212
|------|------------|--------------|
1313
| `codeant_scans_orgs` | read | List authenticated CodeAnt orgs. |
14-
| `codeant_scans_repos` | read | List repos in an org. |
14+
| `codeant_scans_repos` | read | List repos in an org (slim records, paged: `search`, `limit`, `offset`, `full`). |
1515
| `codeant_scans_history` | read | Recent scan runs for a repo. |
1616
| `codeant_scans_get` | read | Severity/category summary for one scan. |
1717
| `codeant_scans_results` | read | Full findings (SAST, SCA, secrets, IaC, …) for one scan. |
@@ -20,18 +20,20 @@ The CodeAnt CLI ships an MCP (Model Context Protocol) server that exposes CodeAn
2020
| `codeant_hotlist_list` | read | Prioritized organization-wide Hotlist findings with stable IDs. |
2121
| `codeant_hotlist_get` | read | One complete Hotlist finding by stable ID. |
2222
| `codeant_findings_antipatterns` | read | Anti-pattern findings across selected or all organization repos (paged: `limit`, `offset`, `all`). |
23-
| `codeant_cloud_scan_history` | read | AWS/Azure/GCP CSPM, VM, or container scan history. |
24-
| `codeant_cloud_findings_list` | read | Findings for one CSPM, VM, or container scan (VM/container paged: `limit`, `offset`, `all`). |
23+
| `codeant_cloud_scan_history` | read | AWS/Azure/GCP CSPM, VM, or container scan history (newest first, 10 per provider by default and up to 200, paged with `limit`/`offset`, without per-service rollups unless `full`). |
24+
| `codeant_cloud_findings_list` | read | Findings for one CSPM, VM, or container scan (paged: `limit`, `offset`, `all`; compliance mappings only with `full`). |
2525
| `codeant_cloud_finding_get` | read | Full detail for one cloud finding UID. |
26-
| `codeant_pentest_history` | read | Pentest engagement history. |
26+
| `codeant_pentest_history` | read | Pentest engagement history (paged: `limit`, `offset`, `full`). |
2727
| `codeant_pentest_issues` | read | All available issues for a pentest engagement. |
2828
| `codeant_pentest_report` | read | Full pentest customer report. |
2929
| `codeant_api_get` | read | Authenticated GET request to any relative CodeAnt app API path, with exact org/provider context. |
3030
| `codeant_pr_list` | read | List PRs/MRs across GitHub, GitLab, Bitbucket, Azure DevOps. |
3131
| `codeant_pr_get` | read | Detail for a PR/MR. |
3232
| `codeant_pr_comments` | read | Comments on a PR, filtered. |
3333
| `codeant_comments_search` | read | Free-text search across CodeAnt review comments. |
34-
| `codeant_review_local` | read | Run a CodeAnt review on local working-copy changes. |
34+
| `codeant_review_local` | read | Run a CodeAnt review on local working-copy changes in the server's working directory. |
35+
| `codeant_login` | auth | Start browser sign-in; returns the sign-in link immediately. Call again to confirm. |
36+
| `codeant_logout` | auth | Revoke and clear the saved token (shared with the CLI). |
3537
| `codeant_scans_start` | **write** | Trigger a new scan. Gated. |
3638
| `codeant_pr_resolve` | **write** | Resolve a PR conversation thread. Gated. |
3739
| `codeant_api_request` | **write** | Authenticated POST/PUT/PATCH/DELETE request to a relative CodeAnt app API path, with exact org/provider context. Gated. |
@@ -40,17 +42,24 @@ Write tools are only registered when `CODEANT_READ_ONLY=0`. Default = read-only.
4042

4143
For complete finding coverage, examples, tenant/provider selection, and response details, see the [CodeAnt findings documentation](https://docs.codeant.ai/cli/findings).
4244

43-
Every tool carries MCP annotations (`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) so the client can decide whether to auto-approve calls.
45+
Every tool carries MCP annotations (`title`, `readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) so the client can decide whether to auto-approve calls. The server also sends `instructions` (discovery order, paging, auth recovery) in its `initialize` result.
46+
47+
Results are compact JSON. Any result over `CODEANT_MCP_MAX_RESULT_CHARS` characters is refused with an error and a narrowing hint; [src/mcp/shape.js](src/mcp/shape.js) holds the MCP-only projections and page defaults. CLI commands keep their full output.
48+
49+
`codeant_login` runs sign-in in the background: the first call returns `{ status: "pending", loginUrl, browserOpened }`, and the next call returns `{ status: "success" }` once the user finishes. The token is read from `~/.codeant/config.json` on every request, so CLI logins and logouts apply to a running server.
4450

4551
## Configuration (env vars)
4652

4753
| Var | Purpose | Default |
4854
|-----|---------|---------|
49-
| `CODEANT_API_TOKEN` | API token (CodeAnt account → settings → API). Required. | — |
50-
| `CODEANT_API_URL` | API base URL. Override for self-hosted. | `https://api.codeant.ai` |
51-
| `CODEANT_READ_ONLY` | `1` to hide write tools, `0` to expose them. | `1` |
55+
| `CODEANT_API_TOKEN` | API token. Optional: without it the server uses the token saved by `codeant login` or `codeant_login`. | — |
56+
| `CODEANT_API_URL` | API base URL. Override for self-hosted. | `https://service.codeant.ai` |
57+
| `CODEANT_DASHBOARD_URL` | Web app URL used by `codeant_login`. Needed on self-hosted base URLs. | detected |
58+
| `CODEANT_READ_ONLY` | `0` or `false` exposes write tools; anything else hides them. | read-only |
59+
| `CODEANT_TELEMETRY_DISABLED` | `1` or `true` stops usage events (PostHog, tied to the API token). | enabled |
60+
| `CODEANT_MCP_MAX_RESULT_CHARS` | Largest tool result, in characters, before the server refuses it with a hint. | `80000` |
5261

53-
The CLI also reads these from `~/.codeant/config.json` when not set in env. For MCP usage prefer env — it keeps per-client config explicit.
62+
The token, base URL, and dashboard URL fall back to `~/.codeant/config.json` when not set in env. PR tools also need an SCM token (`GITHUB_TOKEN`, `GITLAB_TOKEN`, `BITBUCKET_TOKEN`, `AZURE_DEVOPS_TOKEN`) and, for Azure DevOps, `AZURE_DEVOPS_ORG_URL`.
5463

5564
---
5665

@@ -109,10 +118,13 @@ npm run mcpb:build
109118
open -a Claude dist/codeant.mcpb
110119
```
111120

112-
Claude pops an install dialog asking for the `user_config` fields:
113-
- **CodeAnt API token** (sensitive, required)
114-
- **API base URL** (defaults to `https://api.codeant.ai`)
121+
Claude pops an install dialog asking for the `user_config` fields (all optional):
122+
- **CodeAnt API token** (sensitive; leave blank and call `codeant_login` instead)
123+
- **API base URL** (defaults to `https://api.codeant.ai`, which the CLI maps to `https://service.codeant.ai`)
124+
- **Dashboard URL** (self-hosted only; used by `codeant_login`)
115125
- **Read-only mode** (defaults to on)
126+
- **Disable telemetry** (defaults to off)
127+
- SCM tokens and self-hosted SCM URLs for the PR tools
116128

117129
After install, manage it in **Settings → Connectors**.
118130

@@ -162,7 +174,7 @@ cd dist/mcpb-stage
162174
'{"jsonrpc":"2.0","id":2,"method":"tools/list"}'; sleep 1) | node server/index.js
163175
```
164176

165-
Expect 23 tools in the `tools/list` response (or 26 if `CODEANT_READ_ONLY=0`).
177+
Expect 24 tools in the `tools/list` response (or 27 if `CODEANT_READ_ONLY=0`). `tests/mcp/server.test.js` checks that this list matches the manifest's `tools`.
166178

167179
### Bumping the version
168180

@@ -191,9 +203,9 @@ CodeAnt's MCP server uses stdio + a packaged bundle, so the submission route is
191203

192204
Reviewer notes worth preparing:
193205

194-
- **Auth model.** CodeAnt uses a user-scoped API token entered into `user_config.api_token`. The token never leaves the user's machine — the bundle talks to `api.codeant.ai` (or the user's self-hosted URL) directly. No third-party OAuth flow needed.
206+
- **Auth model.** Users sign in with the `codeant_login` tool (browser sign-in, token saved to `~/.codeant/config.json`) or paste a token into `user_config.api_token`. The token is stored only on the user's machine (`~/.codeant/config.json`) and is sent only to the CodeAnt API (or the user's self-hosted URL) as a Bearer token — never to any third party. No third-party OAuth flow needed.
195207
- **Sandbox creds.** Email support@codeant.ai for a reviewer sandbox token; paste it into the submission form's reviewer-notes field along with an org slug that has scans + PRs to browse.
196-
- **Write tools.** Gated behind `user_config.read_only` (defaults to on). Reviewers can toggle off to test `codeant_scans_start` / `codeant_pr_resolve`.
208+
- **Write tools.** Gated behind `user_config.read_only` (defaults to on). Reviewers can toggle off to test `codeant_scans_start` / `codeant_pr_resolve` / `codeant_api_request`.
197209

198210
---
199211

@@ -204,5 +216,8 @@ Reviewer notes worth preparing:
204216
| Server fails to start in Claude Desktop | `~/Library/Logs/Claude/mcp-server-codeant.log` |
205217
| Tool calls return errors | Same log — server stderr is captured there. |
206218
| Tool not listed at all | Check `CODEANT_READ_ONLY` — write tools are hidden when set to `1`. |
207-
| Auth errors on every tool | Confirm `CODEANT_API_TOKEN` is set in the MCP env (not just in `~/.codeant/config.json`). |
219+
| Auth errors on every tool | Call `codeant_login`, or run `codeant login` in a terminal; the server reads `~/.codeant/config.json` on every request. An explicit `CODEANT_API_TOKEN` in the MCP env takes precedence, so check it is current. |
220+
| `codeant_login` fails on a self-hosted instance | Set `CODEANT_DASHBOARD_URL` (or the MCPB **Dashboard URL** setting, or `codeant set-dashboard-url`). |
221+
| A tool returns "Result too large" | Follow the hint (smaller `limit`, filters, `fields`), or raise `CODEANT_MCP_MAX_RESULT_CHARS` if your client accepts larger results. |
222+
| `codeant_review_local` returns "Could not find a .git directory" | The client started the server outside a git repository (Claude Desktop does). Use a project-scoped client such as Claude Code. |
208223
| MCPB install dialog never appears | Open `.mcpb` with `open -a Claude dist/codeant.mcpb` to force the desktop app to handle it. |

‎mcpb/manifest.json‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"display_name": "CodeAnt AI",
55
"version": "0.5.3",
66
"description": "Drive CodeAnt AI security scans and code review from Claude — org-wide secret triage, cross-repo SAST/SCA findings, on-demand scans, and local PR review.",
7-
"long_description": "CodeAnt AI inside Claude. Ask things like \"show my highest-priority Hotlist findings\", \"list AWS cloud findings\", \"show this pentest report\", or \"review my staged changes\" — Claude calls the CodeAnt API directly via this MCP server.\n\nIncludes 23 read-only tools, including repository, Hotlist, cloud security, anti-pattern, and pentest findings plus an authenticated GET escape hatch for new APIs, and 3 opt-in write tools gated behind a setting.\n\nRequires a CodeAnt account. Sign up at https://codeant.ai. To authenticate, call the `codeant_login` tool — it opens the CodeAnt sign-in page in your browser and saves the token automatically.\n\nCollects anonymous usage telemetry via PostHog by default; set CODEANT_TELEMETRY_DISABLED=1 to opt out.",
7+
"long_description": "CodeAnt AI inside Claude. Ask things like \"show my highest-priority Hotlist findings\", \"list AWS cloud findings\", \"show this pentest report\", or \"review my staged changes\" — Claude calls the CodeAnt API directly via this MCP server.\n\nIncludes 22 read-only tools, covering repository, Hotlist, cloud security, anti-pattern, and pentest findings plus an authenticated GET escape hatch for new APIs, 2 sign-in tools, and 3 opt-in write tools gated behind a setting.\n\nRequires a CodeAnt account. Sign up at https://codeant.ai. To authenticate, call the `codeant_login` tool — it returns a sign-in link (and opens it in your browser when it can), then saves the token once you finish.\n\nCollects usage telemetry via PostHog by default (events are tied to your CodeAnt token); turn on \"Disable telemetry\" in the extension settings to opt out.",
88
"author": {
99
"name": "CodeAnt AI",
1010
"email": "support@codeant.ai",
@@ -36,7 +36,9 @@
3636
"env": {
3737
"CODEANT_API_TOKEN": "${user_config.api_token}",
3838
"CODEANT_API_URL": "${user_config.base_url}",
39+
"CODEANT_DASHBOARD_URL": "${user_config.dashboard_url}",
3940
"CODEANT_READ_ONLY": "${user_config.read_only}",
41+
"CODEANT_TELEMETRY_DISABLED": "${user_config.telemetry_disabled}",
4042
"GITHUB_TOKEN": "${user_config.github_token}",
4143
"GITLAB_TOKEN": "${user_config.gitlab_token}",
4244
"BITBUCKET_TOKEN": "${user_config.bitbucket_token}",
@@ -61,6 +63,7 @@
6163
{ "name": "codeant_scans_get", "description": "Get summary metadata for a single scan (no findings)." },
6264
{ "name": "codeant_scans_results", "description": "Fetch full findings (SAST, SCA, secrets, IaC, etc.) for a scan." },
6365
{ "name": "codeant_scans_dismissed", "description": "List dismissed alerts for a repository." },
66+
{ "name": "codeant_scans_overrides", "description": "List user false-positive, confidence, and severity overrides for a repository." },
6467
{ "name": "codeant_hotlist_list", "description": "List prioritized organization-wide Hotlist findings with stable IDs." },
6568
{ "name": "codeant_hotlist_get", "description": "Fetch one complete Hotlist finding by its stable ID." },
6669
{ "name": "codeant_findings_antipatterns", "description": "List anti-pattern findings across selected or all organization repositories." },
@@ -76,7 +79,7 @@
7679
{ "name": "codeant_pr_comments", "description": "List comments on a PR/MR with optional filters." },
7780
{ "name": "codeant_comments_search", "description": "Search across CodeAnt review comments by free-text query." },
7881
{ "name": "codeant_review_local", "description": "Run a CodeAnt AI review on local working-copy changes." },
79-
{ "name": "codeant_login", "description": "Open app.codeant.ai in the browser and poll until the user completes sign-in; saves the resulting API token." },
82+
{ "name": "codeant_login", "description": "Start browser sign-in to CodeAnt AI and return the sign-in link; saves the API token once sign-in completes." },
8083
{ "name": "codeant_logout", "description": "Clear the saved API token and sign out of CodeAnt AI." },
8184
{ "name": "codeant_scans_start", "description": "Trigger a new scan run (write — gated behind read_only=false)." },
8285
{ "name": "codeant_pr_resolve", "description": "Resolve a PR conversation thread (write — gated behind read_only=false)." },
@@ -98,13 +101,27 @@
98101
"required": false,
99102
"default": "https://api.codeant.ai"
100103
},
104+
"dashboard_url": {
105+
"type": "string",
106+
"title": "Dashboard URL",
107+
"description": "Self-hosted only: the URL of your CodeAnt web app, used by codeant_login. Leave blank to detect it from the API base URL.",
108+
"required": false,
109+
"default": ""
110+
},
101111
"read_only": {
102112
"type": "boolean",
103113
"title": "Read-only mode",
104-
"description": "When enabled, write tools (trigger scan, resolve PR thread) are hidden. Recommended.",
114+
"description": "When enabled, write tools (trigger scan, resolve PR thread, write API requests) are hidden. Recommended.",
105115
"required": false,
106116
"default": true
107117
},
118+
"telemetry_disabled": {
119+
"type": "boolean",
120+
"title": "Disable telemetry",
121+
"description": "Stop sending usage events (PostHog) from this extension.",
122+
"required": false,
123+
"default": false
124+
},
108125
"github_token": {
109126
"type": "string",
110127
"title": "GitHub token",
@@ -140,7 +157,7 @@
140157
"github_api_url": {
141158
"type": "string",
142159
"title": "GitHub API URL",
143-
"description": "Override for GitHub Enterprise Server (e.g. https://github.example.com/api/v3). Leave blank for GitHub.com.",
160+
"description": "GitHub Enterprise Server only: the server root, e.g. https://github.example.com (/api/v3 is added automatically). Leave blank for GitHub.com.",
144161
"required": false,
145162
"default": ""
146163
},

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codeant-cli",
3-
"version": "0.5.9",
3+
"version": "0.5.10",
44
"description": "Code review CLI tool",
55
"type": "module",
66
"repository": {

0 commit comments

Comments
 (0)