Product Introduction
xmcp is a framework specifically designed for building and deploying applications within the Model Context Protocol (MCP) ecosystem. It provides a structured development environment that prioritizes developer experience (DX) through automation, conventions, and tooling. The framework simplifies the creation of MCP-compatible tools while maintaining compatibility with modern web development stacks like Next.js and Express.
The core value of xmcp lies in its ability to reduce the complexity of developing MCP-powered applications. By offering file-based conventions, hot reloading, and deployment flexibility, it enables developers to focus on business logic rather than infrastructure setup. This lowers the barrier to entry for both new and experienced developers working within the MCP ecosystem.
Main Features
File System Routing: Tools are automatically registered when placed in the
tools/directory, eliminating manual configuration. This convention-over-configuration approach ensures consistent project structures and reduces boilerplate code. Nested directories create hierarchical routes, and TypeScript support enables type-safe tool definitions. The system dynamically updates routes during development without requiring restarts.Hot Reloading: Changes to tools, middleware, or configurations trigger instant updates in the development environment. This feature accelerates iteration cycles by preserving application state during reloads. Full-stack reloading covers TypeScript transpilation, middleware adjustments, and tool logic modifications. Developers receive immediate feedback through integrated error reporting and WebSocket-based client notifications.
Middleware Architecture: Custom middleware can intercept and modify HTTP requests/responses before they reach MCP tools. Authentication, logging, and request validation logic are implemented through TypeScript/JavaScript files in
middleware.ts. Execution order is configurable viaxmcp.config.ts, enabling precise control over the request lifecycle. Built-in middleware handles common tasks like CORS and body parsing.Extensible Configuration: The
xmcp.config.tsfile supports environment-specific settings, deployment targets, and plugin integrations. TypeScript validation ensures configuration integrity during build processes. Advanced users can extend configurations with custom modules or third-party plugins. The framework merges base configurations with environment overrides for flexible deployment scenarios.Multi-Platform Deployment: Preconfigured adapters enable deployment to Vercel, Express, Next.js, or standalone Node.js servers. The build process generates optimized artifacts in the
dist/directory with tree-shaken dependencies. Serverless deployments include automatic route partitioning for platforms like Vercel Edge Functions. Dockerfiles and CI/CD templates are provided for containerized environments.Tool Auto-Discovery: The framework scans the
tools/directory recursively to register MCP endpoints at startup. File naming conventions map directly to API routes (e.g.,tools/search.tsbecomes/api/search). TypeScript interfaces validate tool signatures against MCP specifications during development. This eliminates manual endpoint registration while maintaining protocol compliance.
Problems Solved
Complex MCP Integration: Traditional MCP development requires manual protocol implementation and endpoint management. xmcp abstracts these complexities through automated tool registration and built-in specification compliance. Developers avoid low-level protocol handling while maintaining full compatibility with MCP standards.
Developer Productivity Bottlenecks: Slow iteration cycles caused by manual restarts and configuration drift are eliminated. Hot reloading and file-based conventions reduce context-switching between code and infrastructure management. Teams can prototype MCP tools 60-80% faster compared to manual setups.
Legacy System Modernization: Enterprises can incrementally adopt MCP by integrating xmcp into existing Next.js or Express applications. The framework coexists with traditional REST APIs, allowing gradual migration of endpoints to MCP. This reduces risk while enabling adoption of protocol-specific features like structured data streaming.
Unique Advantages
Protocol-Specific Optimization: Unlike generic backend frameworks, xmcp includes MCP-aware features like automatic protocol buffer serialization and OpenAPI schema generation. Built-in validators ensure all tools adhere to MCP specifications, reducing runtime errors.
Hybrid Development Model: Developers can combine file-based routing with programmatic tool registration for complex use cases. This balances convention with flexibility, supporting everything from simple CRUD tools to AI-enhanced analytics pipelines.
Vercel-Native Tooling: xmcp provides optimized serverless configurations for Vercel, including edge runtime adaptations and cold-start mitigation strategies. Deployment times are 40% faster than manual setups due to preconfigured build pipelines and route partitioning.
Frequently Asked Questions (FAQ)
How do I add authentication to MCP tools? Implement authentication logic in
middleware.tsusing xmcp's request interception API. The framework supports JWT validation, OAuth flows, and custom authentication providers. Middleware can attach user context to requests for tool-specific authorization checks.Can I use xmcp with existing databases? Yes, xmcp tools can integrate with any database through standard Node.js drivers or ORMs. The framework provides lifecycle hooks for connection pooling and includes examples for PostgreSQL, MongoDB, and Firebase. Database connections are managed in middleware or tool initialization scripts.
What monitoring solutions work with xmcp? The middleware system supports integration with APM tools like Datadog or New Relic. Built-in metrics endpoints expose tool performance data in Prometheus format. Distributed tracing headers are automatically propagated through MCP tool executions.
How does xmcp handle versioning for MCP tools? Versioning is managed through directory structures (
/v1/tools/...) or HTTP headers. The configuration file supports route prefixes and version-specific middleware. Protocol buffer definitions can be versioned alongside tools using theschemas/directory.Is there a limit to tool complexity? xmcp scales horizontally using built-in clustering or platform-specific scaling rules. Individual tools can be decomposed into submodules, with hot reloading maintaining state across dependencies. The framework has been stress-tested with tools processing 10,000+ requests per second.
