Skip to content

Conversation

@naji247
Copy link
Member

@naji247 naji247 commented Nov 24, 2025

Summary

  • Add publishCustomEvent() function that allows publishing arbitrary events to MCPCat outside of standard tool call tracking
  • Enables tracking custom business logic, user actions, and errors
  • Works with tracked MCP servers or custom session IDs
  • Supports flexible event metadata (resourceName, parameters, response, message, duration, isError, error)
  • Derives session IDs deterministically for custom sessions

Test plan

  • Unit tests added for all scenarios (12 tests in publishCustomEvent.test.ts)
  • Tests pass locally
  • Lint and typecheck pass

@naji247 naji247 requested a review from kashishhora November 24, 2025 22:40
resourceName?: string;
parameters?: any;
response?: any;
message?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be the userIntent field? Perhaps we should keep name consistent w/ built-in events?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally made it different here to improve the interface for custom events which don't technically have "user intent" information.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm, i see how you handled it at the publishing level

Add publishCustomEvent() function that allows publishing arbitrary events
to MCPCat outside of standard tool call tracking. This enables tracking
custom business logic, user actions, and errors.

Features:
- Works with tracked MCP servers or custom session IDs
- Supports flexible event metadata (resourceName, parameters, response, etc.)
- Includes error tracking with isError and error fields
- Derives session IDs deterministically for custom sessions
@naji247 naji247 merged commit ac96b3c into main Nov 24, 2025
8 checks passed
@naji247 naji247 deleted the feat-custom-events branch November 24, 2025 22:49
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.

3 participants