feat(mcp): add Notra server#2190
Conversation
51df24f to
4194292
Compare
Greptile SummaryThis PR adds a Notra MCP server entry to the catalog with bearer-token auth, ships the Notra SVG icon, and fixes the
Confidence Score: 3/5The catalog entry and SVG are safe to merge as infrastructure, but the Authorization header placeholder will reach users in a broken state without a code fix first. The Notra Authorization header ships with the literal value src/shared/mcp/catalog.ts — the Authorization header value needs to match the clearPlaceholders convention used by every other credential-bearing entry in the catalog.
|
| Filename | Overview |
|---|---|
| src/shared/mcp/catalog.ts | Adds Notra catalog entry; the Authorization header placeholder 'Bearer YOUR_API_KEY' won't be cleared by clearPlaceholders, causing users to see (and potentially save) a broken placeholder value |
| src/renderer/utils/mcp-icon-data.ts | Switches width/height regex from \b to \s; correctly removes the preceding whitespace with the attribute, avoiding leftover double-spaces in the processed SVG output |
| src/assets/images/mcp/notra.svg | New Notra icon SVG; paths use explicit fills so the duplicate fill attribute that prepareInlineSvgMarkup produces (prepending fill="currentColor" while the root fill="none" remains) has no visual impact |
Sequence Diagram
sequenceDiagram
participant User
participant McpModal
participant clearPlaceholders
participant NotraAPI
User->>McpModal: Open Notra catalog entry
McpModal->>clearPlaceholders: Process header entries
Note over clearPlaceholders: v.startsWith('YOUR_') check fails for 'Bearer YOUR_API_KEY'
clearPlaceholders-->>McpModal: Returns unchanged value 'Bearer YOUR_API_KEY'
McpModal->>User: "Shows pre-filled Authorization = 'Bearer YOUR_API_KEY'"
User->>McpModal: Clicks Add (without editing)
McpModal->>NotraAPI: Authorization: Bearer YOUR_API_KEY
NotraAPI-->>User: 401 Unauthorized
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
src/shared/mcp/catalog.ts:172-174
The `clearPlaceholders` helper in `McpModal.tsx` clears header values only when they `startsWith('YOUR_')`. The value `'Bearer YOUR_API_KEY'` starts with `'Bearer '`, so it is never cleared. When a user opens the Notra catalog entry, the Authorization field will be pre-filled with the literal string `Bearer YOUR_API_KEY`, the required-credential amber warning won't fire (the value is non-empty), and a user who clicks "Add" without editing will send a broken token to the API on every request.
```suggestion
headers: {
Authorization: 'YOUR_BEARER_TOKEN',
},
```
Reviews (1): Last reviewed commit: "fix(mcp): update notra description" | Re-trigger Greptile
| headers: { | ||
| Authorization: 'Bearer YOUR_API_KEY', | ||
| }, |
There was a problem hiding this comment.
The
clearPlaceholders helper in McpModal.tsx clears header values only when they startsWith('YOUR_'). The value 'Bearer YOUR_API_KEY' starts with 'Bearer ', so it is never cleared. When a user opens the Notra catalog entry, the Authorization field will be pre-filled with the literal string Bearer YOUR_API_KEY, the required-credential amber warning won't fire (the value is non-empty), and a user who clicks "Add" without editing will send a broken token to the API on every request.
| headers: { | |
| Authorization: 'Bearer YOUR_API_KEY', | |
| }, | |
| headers: { | |
| Authorization: 'YOUR_BEARER_TOKEN', | |
| }, |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/shared/mcp/catalog.ts
Line: 172-174
Comment:
The `clearPlaceholders` helper in `McpModal.tsx` clears header values only when they `startsWith('YOUR_')`. The value `'Bearer YOUR_API_KEY'` starts with `'Bearer '`, so it is never cleared. When a user opens the Notra catalog entry, the Authorization field will be pre-filled with the literal string `Bearer YOUR_API_KEY`, the required-credential amber warning won't fire (the value is non-empty), and a user who clicks "Add" without editing will send a broken token to the API on every request.
```suggestion
headers: {
Authorization: 'YOUR_BEARER_TOKEN',
},
```
How can I resolve this? If you propose a fix, please make it concise.
Summary