
MCP Framework
Author: QuantGeekDev
Description: TypeScript-first framework (built on the official MCP SDK) for building Model Context Protocol (MCP) servers with automatic directory-based discovery of tools/resources/prompts, a CLI to scaffold and manage servers, built-in Zod schema validation & documentation enforcement, multiple transports (stdio, SSE, HTTP Stream), and optional auth for network transports (OAuth 2.1/PKCE, JWT, API key, or custom). Core capabilities: - Tool input schemas with Zod + required `.describe()` on fields; type inference via `McpInput<this>` - Server transports: stdio (default), SSE, HTTP Stream (batch/stream response modes) - SSE/HTTP Stream auth: OAuth 2.1 (spec-aligned), JWT, API key; supports JWKS + introspection strategies; exposes `/.well-known/oauth-protected-resource` for OAuth discovery. Docs: https://mcp-framework.com/
Stars: 906
Forks: 102
License: MIT License
Category: Open Source
Overview
Installation
# Install the framework globally
npm install -g mcp-framework
# Create a new MCP server project
mcp create my-mcp-server
# Navigate to your project
cd my-mcp-server
# Your server is ready to use!mcp create <your project name here> --http --port 1337 --cors# Build with automatic validation
npm run build
# (Optional) validate tools independently
mcp validate
# Run the compiled server
node dist/index.js{
"mcpServers": {
"${projectName}": {
"command": "node",
"args": ["/absolute/path/to/${projectName}/dist/index.js"]
}
}
}{
"mcpServers": {
"${projectName}": {
"command": "npx",
"args": ["${projectName}"]
}
}
}FAQs
Can MCP servers be containerized using Docker or Kubernetes?
Yes. MCP servers are standard Node.js applications that containerize like any other. For Docker, package the TypeScript build output, install runtime dependencies, expose the appropriate port for HTTP Stream or SSE transports, and configure environment variables for auth. For Kubernetes, define Deployments with mounted config files, resource limits, health checks, and Secrets for credentials. Stdio transport servers run as child processes spawned by the AI client, so containerizing the client application makes more sense than containerizing the stdio server alone. Network-based transports like HTTP Stream are better suited for containerized deployments because they expose standard HTTP endpoints compatible with reverse proxies and load balancers.
Can I use Visual Studio Code to manage MCP servers?
Yes. VS Code supports MCP server management through a `.vscode/mcp.json` file at your workspace root, through `settings.json` configuration, or through extensions like Copilot MCP plus Agent Skills Manager. You can also register servers programmatically via `package.json` and runtime methods like `vscode.lm.registerMcpServerDefinitionProvider()`. Once configured, MCP tools appear in Copilot Chat's Agent Mode, where the AI can access server-provided capabilities like database queries or file operations after requesting permission. This functionality continues to evolve, so monitor official documentation for schema updates.
Are there any best practices for rolling back an MCP update if it fails?
Pin exact framework versions in `package.json` using strict semver (e.g., `"mcp-framework": "0.2.18"` not `"^0.2.18"`). Before updating, commit your working `dist/` build and `package-lock.json` to version control, then test the new version in an isolated branch using MCP Inspector. If the update breaks, revert by checking out the previous commit, running `npm ci` to restore exact dependencies, and rebuilding with `npm run build`. For production HTTP Stream deployments, maintain parallel server instances behind a load balancer so you can route traffic back to the stable version instantly. Because MCP Framework is pre-1.0, treat every minor version bump as potentially breaking.
What are the best practices for deploying an MCP server?
Select the right transport first: Streamable HTTP for remote access, stdio for local scenarios. Implement session management with unique session IDs, storing transports by session with cleanup handlers to prevent memory leaks. Containerize with Docker multi-stage builds using lightweight base images like `node:22-slim`. Infrastructure options include Cloudflare Workers for serverless, Azure Container Apps with Entra ID for managed auth, or local rootless Podman containers with systemd services. Before going live, test with MCP Inspector, pin framework versions, load-test HTTP deployments to catch session-management issues, and monitor resource usage to inform autoscaling policies.
How can I optimize the performance of an MCP server?
Focus on batching, caching, and deployment topology. Batching groups multiple requests for higher throughput but requires monitoring to prevent latency growth. Caching stores embeddings and intermediate results to avoid recomputation on repeated tool calls. For servers running inference models, apply pruning and quantization to reduce resource demands, and deploy with autoscaling and GPU fractioning to share resources across models. Choose your deployment environment based on workload: SaaS for prototyping, VPC for predictable loads, on-prem for regulated data. For HTTP Stream servers, colocate inference nodes with vector stores to reduce latency and egress costs.
How do I add a custom connector to Claude Desktop for an MCP server?
For remote servers, open Claude Desktop, go to **Settings > Connectors > Add custom connector**, enter your server name and URL, add OAuth credentials if needed, then restart. For local stdio servers, go to **Settings > Developer > Edit Config** to open `claude_desktop_config.json`, add an `mcpServers` entry specifying the command, arguments, and environment variables, then restart. Free plan users are limited to one custom connector, while Pro, Max, Team, and Enterprise users can add multiple. Always verify your server exposes tools with proper Zod schemas and test with MCP Inspector before connecting.