Skip to content

feat(mcp): add Notra server#2190

Merged
arnestrickmann merged 2 commits into
generalaction:mainfrom
mezotv:emdash/add-notra-mcp
May 24, 2026
Merged

feat(mcp): add Notra server#2190
arnestrickmann merged 2 commits into
generalaction:mainfrom
mezotv:emdash/add-notra-mcp

Conversation

@mezotv
Copy link
Copy Markdown
Contributor

@mezotv mezotv commented May 22, 2026

Summary

  • add Notra to the MCP catalog with bearer token auth
  • add the Notra MCP icon
  • fix inline SVG width/height stripping so icon attributes are removed cleanly

@mezotv mezotv force-pushed the emdash/add-notra-mcp branch from 51df24f to 4194292 Compare May 22, 2026 12:41
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Greptile Summary

This PR adds a Notra MCP server entry to the catalog with bearer-token auth, ships the Notra SVG icon, and fixes the prepareInlineSvgMarkup regex to consume trailing whitespace when stripping width/height attributes (avoiding leftover double-spaces in the processed markup).

  • Catalog entry (catalog.ts): Adds Notra as an HTTP MCP server with an Authorization: Bearer header and marks the key as required.
  • Icon (notra.svg): New two-path SVG using currentColor fills, consistent with the existing icon set.
  • Regex fix (mcp-icon-data.ts): Replaces \\bwidth / \\bheight with \\swidth / \\sheight so the preceding whitespace is removed along with the attribute.

Confidence Score: 3/5

The 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 Bearer YOUR_API_KEY. Because clearPlaceholders only clears values starting with YOUR_, this string is never wiped — the user sees a filled (non-empty) field, gets no amber warning, and can save the config with the placeholder intact. Every subsequent MCP call would include a bogus token and silently fail authentication. The SVG and regex changes are clean.

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.

Important Files Changed

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
Loading
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

Comment thread src/shared/mcp/catalog.ts
Comment on lines +172 to +174
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Suggested change
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.

@arnestrickmann arnestrickmann merged commit 0dab031 into generalaction:main May 24, 2026
1 check passed
@mezotv mezotv deleted the emdash/add-notra-mcp branch May 24, 2026 04:02
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.

3 participants