Commit graph

43 commits

Author SHA1 Message Date
Jerome
4015781772
Merge pull request #7 from modelcontextprotocol/fix-splash-page-styling
Fix splash page styling issues
2025-08-28 00:25:26 +01:00
Jerome
72fcc292f4
Fix splash page styling issues
- Moved inline CSS to external stylesheet to comply with CSP
- Added black background to logo area for visibility of white MCP logo
- Updated specification link to point to dated version (2025-06-18)
- Changed "MCP Everything Server" to "MCP Example Server"
- Added route to serve styles.css file

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-27 23:46:11 +01:00
Jerome
4254bf3e48
Merge pull request #6 from modelcontextprotocol/add-splash-page
Add splash page for MCP Everything Server
2025-08-27 14:55:27 +01:00
Jerome
0e50f08c92
Update package-lock.json dependencies
Refreshed package dependencies to ensure clean installation.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-27 13:54:14 +01:00
Jerome
3e81ec45a8
Add splash page for MCP Everything Server
Implemented a clean, informative splash page at the root endpoint that showcases:
- Server features and capabilities
- API endpoints documentation
- Links to GitHub repository and MCP documentation
- Black and white theme matching MCP branding
- Responsive design for mobile and desktop

The splash page provides users with an immediate overview of the server's functionality
and serves as a landing page for the MCP Everything Server.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 20:07:19 +01:00
Jerome
59afc14742
Added readme to the MCP Everything Server project 2025-07-25 13:13:22 +01:00
Jerome
a7b1083243
Merge pull request #4 from modelcontextprotocol/pcarleton/prm-www
Add PRM metadata to www-authenticate
2025-07-22 13:58:33 +01:00
Paul Carleton
1160524a70
types 2025-07-17 14:20:50 +01:00
Paul Carleton
077fed19b9
Add PRM metadata to www-authenticate 2025-07-17 13:54:28 +01:00
Jerome
927d34c0d1
Fix 'stream is not readable' error in SSE message handler
- Replace getRawBody with direct req.body usage since express.json() middleware already parses it
- Add debugging support with --inspect flag for dev scripts
- Add VS Code launch configurations for debugging

The issue was that getRawBody tried to read an already-consumed stream. Since express.json()
middleware is applied globally, we can directly use req.body instead.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 13:41:34 +01:00
Jerome
2f1aa9c93b
Merge pull request #2 from modelcontextprotocol/feature/streamable-http-transport
Implement streamable HTTP transport with Redis-based session management
2025-07-10 17:30:46 +01:00
Jerome
36f86c2657
Fix TypeScript errors with proper typing
- Add MCPInitResponse interface for test responses
- Replace 'any' types with proper interface
- Remove unused JSONRPCResponse import
- Maintain type safety while fixing build errors

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 17:29:42 +01:00
Jerome
c6f3f40937
Fix all ESLint errors
- Remove unused imports and variables
- Replace 'any' types with proper type guards
- Add comments to empty catch blocks
- Fix Response/Request type imports in logger
- Use 'unknown' instead of 'any' for generic types
- Remove unused createMcpServer and setSessionOwner imports

All ESLint checks now pass.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 16:52:32 +01:00
Jerome
e13aefc8c4
Fix TypeScript type conflicts and update build process
- Add overrides for @types/express to resolve version conflicts
- Remove SDK build step from CI as we're now using published version
- Move mcp.png to src/static folder and update serving path
- Add copy-static script to build process

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 16:39:41 +01:00
Jerome
f52ea9ad03
Bumped sdk version 2025-07-10 16:27:33 +01:00
Jerome
c78aa113c1
Added install for the git cloned dep 2025-07-10 11:40:07 +01:00
Jerome
9d768bc393
Using specific typescript sdk commit 2025-07-10 11:27:48 +01:00
Jerome
46c71a9857
Tidying up static files 2025-07-10 11:17:11 +01:00
Jerome
d67ef14ad6
Add comprehensive structured logging to streamable HTTP
- Remove sensitive data (auth tokens, cookies) from request logging
- Add detailed logging throughout streamable HTTP request lifecycle:
  - Session creation/reuse
  - Session ownership validation
  - Transport initialization
  - Message flow through Redis channels
  - Session shutdown and cleanup
- Add logging for inactivity timeouts and control messages
- Use appropriate log levels (info for lifecycle, debug for details, error for failures)

All logs now include contextual information like sessionId, userId, and channel names
for easier debugging and monitoring.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 11:05:50 +01:00
Jerome
f4aed937f0
Replace console.log with structured logging for Cloud Run
- Add structured logger utility with Cloud Run trace context support
- Uses AsyncLocalStorage for request context propagation
- Replace all console.log/error/warn statements with structured logger
- Add logging middleware to capture request/response metadata
- Support Google Cloud Logging severity levels and trace correlation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-10 10:55:57 +01:00
Jerome
af3ced02d3
Fix test cleanup for ServerRedisTransport
- Add afterEach hook to properly close transport instances
- Prevents hanging tests due to uncleaned inactivity timers
- All 85 tests now pass successfully

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 20:07:51 +01:00
Jerome
f23e31daa6
Removed accidental commit 2025-07-09 19:58:19 +01:00
Jerome
d779401b5f
Add inactivity timeout to ServerRedisTransport
- Add 5-minute inactivity timeout to prevent memory leaks
- Reset timer on each message received from client
- Clear timer on transport close
- Add comprehensive tests for timeout behavior
- Fix async/await in redisRelayToMcpServer calls

Sessions will now automatically shutdown after 5 minutes of no client activity.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 19:42:19 +01:00
Jerome
728c3f66ea
Wired up notifications 2025-07-09 16:24:15 +01:00
Jerome
29f5bde8b2
Fix test suite to properly clean up MCP servers
- Add Accept header to mock requests per MCP spec requirement
- Fix TypeScript build errors in integration tests
- Add shutdownSession calls to properly clean up MCP server intervals
- Update afterEach to ensure proper test cleanup
- Add debug configurations for Jest in VS Code launch.json

All tests now pass without hanging processes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 15:39:44 +01:00
Jerome
88f683ef12
Fix test suite for refactored shttp and redisTransport
- Update tests to handle async session initialization
- Fix session ID retrieval from SSE/JSON responses
- Update DELETE request tests to match new behavior
- Remove references to deprecated startServerListeningToRedis
- Add proper waits for async operations

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 14:50:23 +01:00
Jerome
93bc76fb04
Update mcp service and index exports
- Add cleanup function to mcp server creation
- Export new Redis transport functions from index

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 13:03:05 +01:00
Jerome
5740a7da15
Add session ownership validation to Redis transport
- Implement setSessionOwner, getSessionOwner, and validation functions
- Add isSessionOwnedBy check combining liveness and ownership
- Simplify getShttpTransport by removing cleanup return
- Move cleanup logic to transport onclose handler

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 13:02:50 +01:00
Jerome
75bcc06702
Refactor shttp handler to support user-based session ownership
- Add userId extraction from auth info
- Implement session ownership validation
- Remove DELETE endpoint handling (moved elsewhere)
- Simplify transport lifecycle management
- Add proper 401 responses for unauthorized access

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 13:01:30 +01:00
Jerome
d8e706ff9d
Create beautiful black and white MCP-branded auth pages
**MCP Server Auth Page (src/auth/provider.ts):**
- Black background with white card design
- Official MCP logo and branding
- Clear client information display
- Elegant "Continue to Authentication" flow
- Professional MCP server identification

**Upstream Fake Auth Page (src/handlers/fakeauth.ts):**
- Updated branding to distinguish from MCP server
- Lock icon and "Upstream Authentication" title
- Clear user ID management with localStorage
- Generate/edit user ID functionality for testing
- Multi-user testing instructions

**Technical Updates:**
- Permissive CSP headers for both auth pages
- Logo serving route at /mcp-logo.png
- Responsive design with modern CSS
- Clear visual distinction between MCP server auth vs upstream auth
- Enhanced userId integration in OAuth authorization flow

Both pages now provide professional user experience while maintaining
clear distinction between the MCP server's auth and the fake upstream
provider auth for testing purposes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-08 12:33:30 +01:00
Jerome
20d722a06b
Add userId field to McpInstallation interface
- Add userId: string field to distinguish individual users from OAuth clients
- Prepares for user session isolation implementation
- clientId represents OAuth application, userId represents individual user

This separation allows multiple users to use the same OAuth client while
maintaining session isolation for security.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 20:39:46 +01:00
Jerome
5d72dd4301
Add comprehensive integration tests for shttp handler
- Test Redis subscription cleanup after response completion
- Test DELETE request session termination with control messages
- Test error handling for invalid session IDs
- Test user session isolation scenarios (documents expected behavior)
- Use MockRedisClient directly instead of mocking the mock
- Verify actual Redis channel creation and cleanup behavior
- Add proper Express Response mock with all required methods

Tests cover the three key areas:
1. Redis subscription cleanup after shttp responses
2. MCP server shutdown on DELETE requests
3. Session isolation between authenticated users

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 15:30:51 +01:00
Jerome
f84e54124b
Implement DELETE request handling for session termination
- Add explicit DELETE request handling in handleStreamableHTTP
- Validate session existence before termination
- Send shutdown control messages to clean up Redis resources
- Return proper HTTP status codes (200 for success, 404 for not found)
- Fix TypeScript issue with JSONRPCMessage id access in redisTransport
- Add missing semicolon in startServerListeningToRedis call

Follows MCP specification for explicit session termination.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-07 15:30:11 +01:00
Jerome
f660459275
Remove debugging console logs for cleaner output
- Removed verbose logging from Redis transport operations
- Cleaned up HTTP handler debug statements
- Simplified Redis client logging
- Removed request/response logging middleware
- Maintains error logging for troubleshooting

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 17:28:54 +01:00
Jerome
de8c4a4ed2
Fix Redis transport refactoring with control message system
- Fix timing issue by awaiting startServerListeningToRedis
- Add request-id based response channel routing
- Implement control message system for proper server shutdown
- Add comprehensive integration tests
- Ensure response subscription is established before message sending
- Fix MCP server cleanup integration to prevent async hanging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 17:23:54 +01:00
Jerome
0aa0d19ad8
Complete Redis transport refactoring with request-id based channels
- Implement new ServerRedisTransport for server->client messages using request-specific channels
- Add redisRelayToMcpServer function for dynamic request-id based subscriptions
- Update shttp handler to use new transport return types with cleanup functions
- Remove old relayTransports and helper functions in favor of new architecture
- Add comprehensive test suites for Redis transport and shttp handler components
- Fix linting issues and ensure all tests pass

The new system routes server responses to channels like:
- mcp:shttp:toclient:${sessionId}:${requestId} for request responses
- mcp:shttp:toclient:${sessionId}:__GET_stream for notifications

This enables efficient scaling across multiple shttp instances as each client
only subscribes to channels relevant to their specific requests.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-04 15:23:40 +01:00
Jerome
d62847ef52
Part way through refactoring the redis transport 2025-07-04 12:04:09 +01:00
Jerome
c2119ed9f9
WIP shttp changes 2025-07-01 15:10:55 +01:00
Jerome
8579d446aa
Add comprehensive logging to debug Redis transport issues
- Add detailed logging to Redis transport lifecycle
- Log session validation and message flow
- Track MCP server request handling
- Add diagnostics for streamable HTTP transport connections

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-30 20:29:41 +01:00
Jerome
d691200555
Increase rate limits on client registration (hit while debugging client, I suspect others will also) 2025-06-10 21:47:20 +01:00
Jerome
2b673a28c2
Implement streamable HTTP transport with Redis-based session management
- Add new /mcp endpoint supporting GET, POST, DELETE methods
- Implement SessionManager for Redis-based session state management
- Add MessageDelivery for message buffering when SSE disconnected
- Support horizontal scaling via Redis session storage
- Maintain backwards compatibility with existing /sse and /message endpoints
- Add comprehensive tests for SessionManager functionality
- Session TTL of 5 minutes prevents Redis bloat
- Message buffering for resilient connection handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-05 12:24:04 +01:00
Jerome
93c939614e
Fix tests to work with ES modules and TypeScript
- Updated Jest configuration to use ts-jest ESM preset
- Added NODE_OPTIONS flag for experimental VM modules support
- Fixed import statements in all test files to import Jest globals
- Rewrote provider.test.ts to work with ESM (using actual implementations with mock Redis)
- Fixed test expectations to match actual implementation
- Fixed encryption key generation in tests (using proper 64-char hex tokens)
- Standardized token_type to "Bearer" across codebase
- Removed unused imports to fix lint errors
- Excluded scratch folder from test runs

All tests now pass successfully with proper ES module support.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

Relocked
2025-06-04 13:16:42 +01:00
Jerome
b1d1790f62
Initial commit 2025-06-04 13:16:20 +01:00