nts-add-mcplisted
Install: claude install-skill juncoding/nextjs-trpc-prisma-starter
# Add MCP entry point to an existing project
## Use when
- User wants Claude Desktop, Cursor, or any MCP-compatible AI client to interact with the app.
- User says "expose this to MCP" / "add MCP tools" / "let AI query the data".
- User invokes `/nts-add-mcp`.
## Prerequisite check
This skill requires **Better Auth** to be wired (the OAuth provider behind the MCP plugin). Before doing anything else:
1. Check for `src/server/auth/index.ts` — abort if missing.
2. Check that Better Auth is in `package.json` dependencies — abort if missing.
If auth isn't wired, tell the user to run `/nts-add-auth` first.
## What this skill does
1. Adds the `mcp` plugin to the Better Auth config.
2. Creates `src/app/api/mcp/route.ts` — the Streamable HTTP endpoint, wrapped in `withMcpAuth`.
3. Creates `src/app/.well-known/oauth-authorization-server/route.ts` and `src/app/.well-known/oauth-protected-resource/route.ts` for discovery.
4. Creates `src/server/mcp/registry.ts` — the tool dispatch table.
5. Creates `src/server/mcp/tools/_example-search.ts` — one worked tool wrapping a service.
6. Creates a Prisma migration to add the three OAuth tables (`oauth_application`, `oauth_access_token`, `oauth_consent`).
7. Updates `CLAUDE.md` to document the MCP entry point.
8. Adds dev tunnel instructions to the README (Claude Desktop only accepts HTTPS connectors).
## Confirmation flow
Before writing:
1. Verify project structure (Better Auth present, `src/app/api/` exists).
2. Pick the example tool