Add splash page for MCP Everything Server#6
Merged
jerome3o-anthropic merged 2 commits intomainfrom Aug 27, 2025
Merged
Conversation
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>
Comment on lines
+171
to
+174
| app.get("/", (req, res) => { | ||
| const splashPath = path.join(__dirname, "static", "index.html"); | ||
| res.sendFile(splashPath); | ||
| }); |
Check failure
Code scanning / CodeQL
Missing rate limiting High
This autofix suggestion was applied.
Show autofix suggestion
Hide autofix suggestion
This autofix suggestion was applied.
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 months ago
To fix the problem, we should add a rate-limiting middleware to the route handler for / (the splash page) in src/index.ts. The recommended approach is to use the well-known express-rate-limit package, which is compatible with Express and easy to configure. We will:
- Import
express-rate-limitat the top of the file. - Create a rate limiter instance with reasonable defaults (e.g., 100 requests per 15 minutes per IP).
- Apply the rate limiter middleware to the
/route only, so it does not affect other routes unnecessarily. - Ensure the fix is limited to the code shown, without changing existing functionality.
Suggested changeset
2
src/index.ts
| @@ -2,6 +2,7 @@ | ||
| import { AuthRouterOptions, getOAuthProtectedResourceMetadataUrl, mcpAuthRouter } from "@modelcontextprotocol/sdk/server/auth/router.js"; | ||
| import cors from "cors"; | ||
| import express from "express"; | ||
| import rateLimit from "express-rate-limit"; | ||
| import path from "path"; | ||
| import { fileURLToPath } from "url"; | ||
| import { EverythingAuthProvider } from "./auth/provider.js"; | ||
| @@ -15,6 +16,13 @@ | ||
|
|
||
| const app = express(); | ||
|
|
||
| // Rate limiter for splash page | ||
| const splashLimiter = rateLimit({ | ||
| windowMs: 15 * 60 * 1000, // 15 minutes | ||
| max: 100, // limit each IP to 100 requests per windowMs | ||
| standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers | ||
| legacyHeaders: false, // Disable the `X-RateLimit-*` headers | ||
| }); | ||
| // Get the directory of the current module | ||
| const __filename = fileURLToPath(import.meta.url); | ||
| const __dirname = path.dirname(__filename); | ||
| @@ -168,7 +176,7 @@ | ||
| }); | ||
|
|
||
| // Splash page | ||
| app.get("/", (req, res) => { | ||
| app.get("/", splashLimiter, (req, res) => { | ||
| const splashPath = path.join(__dirname, "static", "index.html"); | ||
| res.sendFile(splashPath); | ||
| }); |
package.json
Outside changed files
| @@ -32,7 +32,8 @@ | ||
| "cors": "^2.8.5", | ||
| "dotenv": "^16.4.7", | ||
| "express": "^4.21.2", | ||
| "raw-body": "^3.0.0" | ||
| "raw-body": "^3.0.0", | ||
| "express-rate-limit": "^8.0.1" | ||
| }, | ||
| "overrides": { | ||
| "@types/express": "^5.0.0", |
This fix introduces these dependencies
| Package | Version | Security advisories |
| express-rate-limit (npm) | 8.0.1 | None |
Copilot is powered by AI and may make mistakes. Always verify output.
Refreshed package dependencies to ensure clean installation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3071db5 to
0e50f08
Compare
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.
Summary
/endpointChanges
src/static/index.htmlsplash page with:src/index.tsto serve the splash page at/Test Plan
/mcp-logo.pngendpointnpm run build- builds successfullynpm run lint- no linting errorsnpm test- all tests pass🤖 Generated with Claude Code