Design Engineer Logo
Visit Repo
Open Graph preview

MCP Framework

A framework for writing modelcontextprotocol (MCP) servers in Typescript

Site favicon
šŸ”Œ MCP Tools

Overview

MCP-Framework

Description:
A TypeScript framework for building elegant and type-safe server implementations

Category: Development Framework

Overview:
MCP-Framework provides a structured approach to building servers with automatic directory-based discovery for tools, resources, and prompts. It offers powerful abstractions with full type safety and includes a CLI for rapid development.

Key Features:

  • Automatic directory discovery for tools, prompts, and resources
  • Type-safe abstractions using TypeScript and Zod
  • CLI tools for project management
  • Built-in error handling and response formatting
  • Support for HTTP requests and dynamic prompt templates

Quick Start:

# Install globally
npm install -g mcp-framework

# Create new project
mcp create my-mcp-server

# Navigate to project
cd my-mcp-server

Claude Desktop Configuration:

{
  "mcpServers": {
    "my-mcp-server": {
      "command": "node",
      "args": ["/absolute/path/to/my-mcp-server/dist/index.js"],
      "env": {
        "SECRET_INFO": "YOUR_API_SECRET"
      }
    }
  }
}

Project Structure:

your-project/
ā”œā”€ā”€ src/
ā”‚   ā”œā”€ā”€ tools/     # Required
ā”‚   ā”œā”€ā”€ prompts/   # Optional
ā”‚   ā”œā”€ā”€ resources/ # Optional
ā”‚   ā””ā”€ā”€ index.ts
ā”œā”€ā”€ package.json
ā””ā”€ā”€ tsconfig.json

Development Commands:

# Add components
mcp add tool tool-name
mcp add prompt prompt-name
mcp add resource resource-name

# Build
npm run build

The framework automatically handles feature discovery and provides base classes (MCPTool, MCPPrompt, MCPResource) with built-in validation using Zod.