Welcome to the comprehensive documentation for the MCP Server Framework - a TypeScript-first framework for building Model Context Protocol (MCP) servers.
Complete TypeScript API documentation generated from source code with TypeDoc.
- Classes: Core framework classes and their methods
- Interfaces: Type definitions and contracts
- Functions: Utility functions and factory methods
- Types: Type aliases and enumerations
Step-by-step tutorials and comprehensive guides for framework usage.
- Getting Started
- Architecture Overview
- Middleware Development
- Transport Integration
- Testing Strategies
Practical code examples and sample implementations.
- Basic Server Setup
- Custom Middleware
- Transport Adapters
- Registry Implementations
Technical reference materials and specifications.
- Configuration Options
- Error Codes
- Protocol Compliance
- Performance Guidelines
import { createMcpKitServer } from '@hexmcp/core';
// Create a basic MCP server - StdioTransport is automatically added
const server = createMcpKitServer()
.tool('echo', {
description: 'Echo back the input',
parameters: {
type: 'object',
properties: {
message: { type: 'string' }
}
},
handler: async ({ message }) => ({ content: [{ type: 'text', text: message }] })
})
.listen(); // No explicit transport needed!import { createMcpKitServer } from '@hexmcp/core';
import { StdioTransport } from '@hexmcp/transport-stdio';
// Explicit transport configuration for advanced use cases
const server = createMcpKitServer()
.tool('echo', { /* ... */ })
.transport(new StdioTransport()) // Explicit transport
.listen();
// Or disable default transport for custom setups
const customServer = createMcpKitServer()
.noDefaultTransport()
.transport(new CustomTransport())
.listen();- Lifecycle Management: Finite state machine for MCP protocol compliance
- Middleware System: Onion-style middleware execution with async/await support
- Transport Abstraction: Support for multiple transport protocols
- Type Safety: Full TypeScript support with comprehensive type definitions
Generated documentation is automatically updated with each release.