Integrations
Supports distribution through npm, allowing developers to publish their MCP servers and have users install them with a simple npx command.
Built specifically for TypeScript with full type safety, enabling developers to create MCP tools, prompts, and resources with proper typing and validation.
Uses Zod for schema validation in tools, allowing developers to define input validation schemas for tool parameters with proper typing and runtime validation.
MCP Framework
A TypeScript framework for building Model Context Protocol (MCP) servers.
Changes from Original
This fork (@ronangrant/mcp-framework) includes the following improvements:
- Replaced file-based logging with console-only logging for better compatibility and reliability
- Removed dependency on filesystem for logs, eliminating ENOENT errors
- Simplified logging implementation while maintaining the same interface
- All logs now output to stderr via console.error()
Installation
Usage
Create a new MCP server:
Features
- Easy-to-use API for creating MCP servers
- Built-in support for tools, prompts, and resources
- Simplified logging system with console output
- Full TypeScript support
- Flexible transport options
License
MIT
MCP-Framework is a framework for building Model Context Protocol (MCP) servers elegantly in TypeScript.
MCP-Framework gives you architecture out of the box, with automatic directory-based discovery for tools, resources, and prompts. Use our powerful MCP abstractions to define tools, resources, or prompts in an elegant way. Our cli makes getting started with your own MCP server a breeze
Features
- 🛠️ Automatic discovery and loading of tools, resources, and prompts
- Multiple transport support (stdio, SSE)
- TypeScript-first development with full type safety
- Built on the official MCP SDK
- Easy-to-use base classes for tools, prompts, and resources
- Out of the box authentication for SSE endpoints
Read the full docs here
Creating a repository with mcp-framework
Using the CLI (Recommended)
CLI Usage
The framework provides a powerful CLI for managing your MCP server projects:
Project Creation
Adding a Tool
Adding a Prompt
Adding a Resource
Development Workflow
- Create your project:
- Add tools as needed:Copy
- Build:Copy
- Add to MCP Client (Read below for Claude Desktop example)
Using with Claude Desktop
Local Development
Add this configuration to your Claude Desktop config file:
MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json` Windows: `%APPDATA%/Claude/claude_desktop_config.json`
After Publishing
Add this configuration to your Claude Desktop config file:
MacOS: `~/Library/Application Support/Claude/claude_desktop_config.json` Windows: `%APPDATA%/Claude/claude_desktop_config.json`
Building and Testing
- Make changes to your tools
- Run `npm run build` to compile
- The server will automatically load your tools on startup
Quick Start
Creating a Tool
Setting up the Server
Transport Configuration
stdio Transport (Default)
The stdio transport is used by default if no transport configuration is provided:
SSE Transport
To use Server-Sent Events (SSE) transport:
CORS Configuration
The SSE transport supports flexible CORS configuration. By default, it uses permissive settings suitable for development. For production, you should configure CORS according to your security requirements:
Authentication
MCP Framework provides optional authentication for SSE endpoints. You can choose between JWT and API Key authentication, or implement your own custom authentication provider.
JWT Authentication
Clients must include a valid JWT token in the Authorization header:
API Key Authentication
Clients must include a valid API key in the X-API-Key header:
Custom Authentication
You can implement your own authentication provider by implementing the AuthProvider
interface:
License
MIT
This server cannot be installed
A TypeScript framework for building Model Context Protocol (MCP) servers with automatic discovery and loading of tools, resources, and prompts.