fix(mcp): harden validation, security, and MCP spec compliance#28
Merged
qasim-nylas merged 1 commit intofeature/native-mcp-serverfrom Feb 27, 2026
Merged
Conversation
Collaborator
mqasimca
commented
Feb 27, 2026
- SEC-001: enforce maxContentLength on newline-delimited JSON payloads
- SEC-004: sanitizeError now strips all http/https URLs via regex
- SEC-005: clamp limit params to max 200 across all list operations
- Fix parseToolCallParams/parseInitializeParams to return parse errors
- Add empty tool name validation before dispatch
- Use errors.Is(err, io.EOF) instead of direct comparison
- Use rune-safe truncation in cleanSnippet and body to prevent splitting multi-byte UTF-8 characters
- Require start_time/start_date with matching end field for events
- Validate end_time > start_time for timed events
- Validate RSVP status is yes/no/maybe with schema enum constraint
- Validate availability requires at least one participant
- Add IdempotentHint to destructive annotations (DELETE is idempotent)
- Add missing fields to update_event schema (start_date, end_date, conferencing_url, reminders) and executor
- Support updating contact emails and phone numbers
- Add hex_color to calendar list response for consistency
- Add signal.Stop and grant ID error logging in serve.go
- Fix tool count 37 -> 47 in mcp.go description
- SEC-001: enforce maxContentLength on newline-delimited JSON payloads - SEC-004: sanitizeError now strips all http/https URLs via regex - SEC-005: clamp limit params to max 200 across all list operations - Fix parseToolCallParams/parseInitializeParams to return parse errors - Add empty tool name validation before dispatch - Use errors.Is(err, io.EOF) instead of direct comparison - Use rune-safe truncation in cleanSnippet and body to prevent splitting multi-byte UTF-8 characters - Require start_time/start_date with matching end field for events - Validate end_time > start_time for timed events - Validate RSVP status is yes/no/maybe with schema enum constraint - Validate availability requires at least one participant - Add IdempotentHint to destructive annotations (DELETE is idempotent) - Add missing fields to update_event schema (start_date, end_date, conferencing_url, reminders) and executor - Support updating contact emails and phone numbers - Add hex_color to calendar list response for consistency - Add signal.Stop and grant ID error logging in serve.go - Fix tool count 37 -> 47 in mcp.go description
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.