nb-mcp-server
Provides tools for managing a user's Target data in the NASEBANAL platform: listing all Targets with their nested cells, retrieving a single Target by id, creating Targets (optionally as sub-targets via a parent id), updating a Target's title/description/memo, and deleting Targets.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@nb-mcp-serverLog a data point: 30 minutes of exercise today"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
nb-mcp-server
A public Remote MCP server that lets you connect Claude Desktop (or any MCP client) to your own Target and Recorder data — for quick data entry and report generation, straight from a chat.
Login works like the Figma or Trello MCP connectors: add the server, a browser popup opens for a NASEBANAL (Auth0) login, and once you approve, the tools unlock for your account. No manual token copy-pasting.
Tools
Target
Tool | Does |
| List all your Targets, with nested cells |
| Get one Target by id |
| Create a Target (optionally as a sub-target via |
| Update a Target's title/description/memo |
| Delete a Target |
Recorder
Tool | Does |
| List logged data points, filterable by tag/date range |
| Log a new data point (auto-creates the tag by name) |
| Update a logged data point |
| List tags — use this to find a tag's numeric id for goals |
| List Goals |
| Create a Goal on an existing tag |
| Summary stats (count/min/max/average/latest) for a tag — the report-generation tool |
Out of scope for now: sharing/collaboration, media upload, public/shared-graph endpoints, bulk operations. These wrap @nasebanal/sdk, which already exposes the full API surface — adding more tools is mostly a matter of registering them in src/mcp/tools/.
Related MCP server: Business Central MCP Workshop Server
How it works
src/index.ts—@cloudflare/workers-oauth-providerowns the top-levelfetch. It validates bearer tokens on/mcpitself and hands everything else to our owndefaultHandler.src/auth/handler.ts— bridges the MCP client's OAuth dance to Auth0:/authorizeredirects to Auth0 login (with its own PKCE leg, separate from the one the OAuth Provider runs against the MCP client);/callbackexchanges the code, resolves the caller's NASEBANAL account vianb.account.me.get()(which also JIT-provisions the user), and completes the grant with that numeric account id asuserId— not the raw Auth0sub, so the grant is purgeable on account deletion (see below).src/mcp/agent.ts—NasebanalMcp, aMcpAgentthat registers the tools above against an@nasebanal/sdkclient authenticated with the session's Auth0 access token.POST /internal/users/purge— implements the org's mandatory account-deletion fan-out contract (seeapps/CLAUDE.md): revokes every OAuth grant for a deleted user.
Auth0 token refresh (2026-09): src/index.ts's tokenExchangeCallback refreshes the downstream Auth0 access token using the stored refresh token every time @cloudflare/workers-oauth-provider renews its own (outer) access token — roughly hourly. Before this was wired up, the outer OAuth grant kept refreshing itself for up to 30 days while silently carrying the stale inner Auth0 token forward, so Claude's connection looked healthy while every tool call failed with a swallowed 401. If the refresh token itself is revoked or the NASEBANAL user is deleted, the callback throws OAuthError('invalid_grant', ...), which fails the outer refresh too — so Claude correctly prompts a fresh login rather than failing silently.
Known deprecation to revisit: agents' McpAgent (the Durable-Object-backed SDK v1 integration used here) is marked feature-frozen upstream in favor of a stateless v2 factory (createStatelessMcpHandler from agents/mcp/server). It's still what Cloudflare's own OAuth-fronted MCP examples use today and remains fully supported, so this was a deliberate choice — revisit once the v2 path has real-world examples to build the auth bridge against.
Setup
1. Auth0 Dashboard (manual — do this first)
Applications → Create Application — name it (e.g.
NASEBANAL MCP Server), type Regular Web Application (a confidential client — needed for the server-side code exchange in/callback; don't reusenb-cli's public Native app).Settings → Allowed Callback URLs — add
https://nb-mcp-server.<your-cf-subdomain>.workers.dev/callback(and your production hostname's/callbackonce you have one).Settings → Advanced → Grant Types — ensure Authorization Code and Refresh Token are both checked.
APIs →
https://api.nasebanal.com→ Allow Offline Access — must be ON, or theoffline_accessscope silently drops and refresh tokens never issue.Copy the Client ID / Client Secret.
2. Local dev
npm install
cp .dev.vars.example .dev.vars # fill in AUTH0_CLIENT_ID / AUTH0_CLIENT_SECRET / INTERNAL_SECRET
wrangler kv namespace create OAUTH_KV # paste the returned id into wrangler.jsonc
npm run devnpx vitest run covers PKCE math, the KV pending-auth store, Auth0 token-exchange request shape, and tool input validation — no live Auth0 needed. A full login round-trip can't run against localhost (Auth0 rejects an unregistered redirect_uri), so first verify that end-to-end after a real deploy.
3. Secrets (after the first deploy)
wrangler secret put AUTH0_CLIENT_ID
wrangler secret put AUTH0_CLIENT_SECRET
wrangler secret put INTERNAL_SECRET # must match the value on the other 4 NASEBANAL APIs4. Connect from Claude Desktop
Settings → Connectors → Add custom connector → the deployed /mcp URL → complete the Auth0 login popup → the Target/Recorder tools appear.
Deployment
Do NOT run wrangler deploy directly. Deploy by merging a PR to main — CI/CD handles the rest.
Follow-ups tracked outside this repo
Add
nb-mcp-servertonb-account-api'sPURGE_TARGETS+ Service Binding, so account deletion actually calls this repo's/internal/users/purge.Add
bin/config/cloudflare/nb-mcp-server.sh(secret management script).Add a row to
apps/CLAUDE.md's port table fornb-mcp-server(dev port8791).
This server cannot be deployed
Maintenance
Related MCP Connectors
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceThis MCP server connects Claude Desktop to OpenCTI for AI-augmented threat intelligence analysis, enabling natural language queries and instant, contextualized answers from your threat intelligence database.29-
- FlicenseNot gradedqualityDmaintenanceMCP server that integrates with Microsoft Dynamics 365 Business Central, enabling querying of customers, items, and sales orders through natural language commands in Claude Desktop.10-
- FlicenseAqualityCmaintenanceMCP server exposing portfolio AI tools including semantic search, evaluation framework, and prompt management, enabling natural language interaction with these services via Claude Desktop.5-
- AlicenseNot gradedqualityCmaintenanceAn MCP server that connects Claude to Teradata GCFR operational reporting, enabling natural-language queries about stream status, process history, loads, transforms, errors, SLA, and data lineage without writing SQL.MIT