Skip to content

feat: custom endpoints#11

Merged
imbenrabi merged 4 commits into
mainfrom
benr/custom-endpoint
Jan 8, 2026
Merged

feat: custom endpoints#11
imbenrabi merged 4 commits into
mainfrom
benr/custom-endpoint

Conversation

@imbenrabi

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR implements custom HTTP endpoint support for MCP servers, allowing developers to define REST-like endpoints alongside MCP protocol endpoints with Zod validation and automatic type inference.

Key Changes

  • New defineEndpoint() and definePermissionAwareEndpoint() helper functions for type-safe endpoint definitions
  • Zod-based validation for request body, query parameters, path parameters, and responses
  • Permission-aware endpoint support that injects permission context into handlers
  • Integration with both standard and permission-based MCP server transports

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/http/customEndpoints.ts Type definitions, interfaces, and helper functions for custom endpoints
src/http/endpointRegistration.ts Core registration logic for custom endpoints with validation
src/http/FastifyTransport.ts Integration with standard transport
src/permissions/PermissionAwareFastifyTransport.ts Integration with permission-aware transport
src/index.ts Public API exports for custom endpoint functionality
src/server/createMcpServer.ts Bug fix to suppress expected "Not connected" errors
tests/customEndpoints.test.ts Comprehensive unit tests (573 lines)
tests/customEndpoints.integration.test.ts Integration tests with both server types (530 lines)
examples/custom-endpoints-demo.ts Example demonstrating all features (557 lines)
package-lock.json Dependency updates
.npmrc npm registry configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@imbenrabi
imbenrabi merged commit 74f03b5 into main Jan 8, 2026
1 check passed
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