Skip to content

fix(mcp): harden validation, security, and MCP spec compliance#28

Merged
qasim-nylas merged 1 commit intofeature/native-mcp-serverfrom
feature/native-mcp-server-4
Feb 27, 2026
Merged

fix(mcp): harden validation, security, and MCP spec compliance#28
qasim-nylas merged 1 commit intofeature/native-mcp-serverfrom
feature/native-mcp-server-4

Conversation

@mqasimca
Copy link
Collaborator

  • 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
@qasim-nylas qasim-nylas merged commit 863fac4 into feature/native-mcp-server Feb 27, 2026
@qasim-nylas qasim-nylas deleted the feature/native-mcp-server-4 branch February 27, 2026 10:54
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.

2 participants