Add CreateJwt MCP tool for Dev Proxy jwt create command - #122
Conversation
Agent-Logs-Url: https://github.com/dev-proxy-tools/mcp/sessions/c01dedf9-ba10-4626-b948-d787f260fe1c Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
jwt create command
garrytrinder
left a comment
There was a problem hiding this comment.
A couple of suggestions for the schema definitions.
| roles: z.array(z.string()).optional().describe('The roles to include in the token'), | ||
| scopes: z.array(z.string()).optional().describe('The scopes to include in the token'), | ||
| claims: z.array(z.string()).optional().describe('Custom claims to include in the token in the format name:value'), | ||
| validFor: z.number().optional().describe('The token validity in minutes'), |
There was a problem hiding this comment.
Consider adding .default(60) here so tokens have a useful lifetime out of the box. Without it, the CLI defaults to 0 minutes (token expires immediately on creation), which isn't practical for testing.
| validFor: z.number().optional().describe('The token validity in minutes'), | |
| validFor: z.number().optional().default(60).describe('The token validity in minutes'), |
There was a problem hiding this comment.
Applied in a4324bf — added .default(60) to validFor.
| scopes: z.array(z.string()).optional().describe('The scopes to include in the token'), | ||
| claims: z.array(z.string()).optional().describe('Custom claims to include in the token in the format name:value'), | ||
| validFor: z.number().optional().describe('The token validity in minutes'), | ||
| signingKey: z.string().optional().describe('The signing key for the token. Must be at least 32 characters'), |
There was a problem hiding this comment.
Since the description already states the minimum length, worth enforcing it at the schema level with .min(32) for a better error message (vs a cryptic CLI error).
| signingKey: z.string().optional().describe('The signing key for the token. Must be at least 32 characters'), | |
| signingKey: z.string().min(32).optional().describe('The signing key for the token. Must be at least 32 characters'), |
There was a problem hiding this comment.
Applied in a4324bf — added .min(32) to signingKey.
|
@copilot address the PR comments |
Agent-Logs-Url: https://github.com/dev-proxy-tools/mcp/sessions/b797be0b-7d7d-4aa7-a6c8-7aa7397c9ea8 Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
garrytrinder
left a comment
There was a problem hiding this comment.
Tested locally — builds clean, all params flow correctly, default validFor and signingKey min validation working as expected. Ship it.
src/createJwt.ts- implements thedevproxy jwt createcommand execution with all supported parameterssrc/index.ts- register the newCreateJwtMCP tool with Zod parameter schemas.default(60)tovalidForfor practical token lifetime out of the box.min(32)tosigningKeyfor schema-level validation