|
3 | 3 | MCP-Framework is a framework for building Model Context Protocol (MCP) servers elegantly in TypeScript.
|
4 | 4 |
|
5 | 5 | 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
|
| 6 | + |
6 | 7 | ## Features
|
7 | 8 |
|
8 |
| -- Automatic discovery and loading of tools, resources, and prompts |
| 9 | +- 🛠️ Automatic discovery and loading of tools, resources, and prompts |
9 | 10 | - Multiple transport support (stdio, SSE)
|
10 | 11 | - TypeScript-first development with full type safety
|
11 | 12 | - Built on the official MCP SDK
|
12 | 13 | - Easy-to-use base classes for tools, prompts, and resources
|
13 |
| -- Optional authentication for SSE endpoints |
| 14 | +- Out of the box authentication for SSE endpoints |
| 15 | + |
| 16 | + |
| 17 | +# [Read the full docs here](https://mcp-framework.com) |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +## Creating a repository with mcp-framework |
| 24 | + |
| 25 | +### Using the CLI (Recommended) |
| 26 | + |
| 27 | +```bash |
| 28 | +# Install the framework globally |
| 29 | +npm install -g mcp-framework |
| 30 | + |
| 31 | +# Create a new MCP server project |
| 32 | +mcp create my-mcp-server |
| 33 | + |
| 34 | +# Navigate to your project |
| 35 | +cd my-mcp-server |
| 36 | + |
| 37 | +# Your server is ready to use! |
| 38 | +``` |
14 | 39 |
|
15 |
| -## Installation |
| 40 | +## CLI Usage |
| 41 | + |
| 42 | +The framework provides a powerful CLI for managing your MCP server projects: |
| 43 | + |
| 44 | +### Project Creation |
| 45 | + |
| 46 | +```bash |
| 47 | +# Create a new project |
| 48 | +mcp create <your project name here> |
| 49 | +``` |
| 50 | + |
| 51 | +### Adding a Tool |
16 | 52 |
|
17 | 53 | ```bash
|
18 |
| -npm install mcp-framework |
| 54 | +# Add a new tool |
| 55 | +mcp add tool price-fetcher |
19 | 56 | ```
|
20 | 57 |
|
| 58 | +### Adding a Prompt |
| 59 | + |
| 60 | +```bash |
| 61 | +# Add a new prompt |
| 62 | +mcp add prompt price-analysis |
| 63 | +``` |
| 64 | + |
| 65 | +### Adding a Resource |
| 66 | + |
| 67 | +```bash |
| 68 | +# Add a new prompt |
| 69 | +mcp add resource market-data |
| 70 | +``` |
| 71 | + |
| 72 | +## Development Workflow |
| 73 | + |
| 74 | +1. Create your project: |
| 75 | + |
| 76 | +```bash |
| 77 | + mcp create my-mcp-server |
| 78 | + cd my-mcp-server |
| 79 | +``` |
| 80 | + |
| 81 | +2. Add tools as needed: |
| 82 | + |
| 83 | + ```bash |
| 84 | + mcp add tool data-fetcher |
| 85 | + mcp add tool data-processor |
| 86 | + mcp add tool report-generator |
| 87 | + ``` |
| 88 | + |
| 89 | +3. Build: |
| 90 | + |
| 91 | + ```bash |
| 92 | + npm run build |
| 93 | + |
| 94 | + ``` |
| 95 | + |
| 96 | +4. Add to MCP Client (Read below for Claude Desktop example) |
| 97 | + |
| 98 | +## Using with Claude Desktop |
| 99 | + |
| 100 | +### Local Development |
| 101 | + |
| 102 | +Add this configuration to your Claude Desktop config file: |
| 103 | + |
| 104 | +**MacOS**: \`~/Library/Application Support/Claude/claude_desktop_config.json\` |
| 105 | +**Windows**: \`%APPDATA%/Claude/claude_desktop_config.json\` |
| 106 | + |
| 107 | +```json |
| 108 | +{ |
| 109 | +"mcpServers": { |
| 110 | +"${projectName}": { |
| 111 | + "command": "node", |
| 112 | + "args":["/absolute/path/to/${projectName}/dist/index.js"] |
| 113 | +} |
| 114 | +} |
| 115 | +} |
| 116 | +``` |
| 117 | + |
| 118 | +### After Publishing |
| 119 | + |
| 120 | +Add this configuration to your Claude Desktop config file: |
| 121 | + |
| 122 | +**MacOS**: \`~/Library/Application Support/Claude/claude_desktop_config.json\` |
| 123 | +**Windows**: \`%APPDATA%/Claude/claude_desktop_config.json\` |
| 124 | + |
| 125 | +```json |
| 126 | +{ |
| 127 | +"mcpServers": { |
| 128 | +"${projectName}": { |
| 129 | + "command": "npx", |
| 130 | + "args": ["${projectName}"] |
| 131 | +} |
| 132 | +} |
| 133 | +} |
| 134 | +``` |
| 135 | + |
| 136 | +## Building and Testing |
| 137 | + |
| 138 | +1. Make changes to your tools |
| 139 | +2. Run \`npm run build\` to compile |
| 140 | +3. The server will automatically load your tools on startup |
| 141 | + |
21 | 142 | ## Quick Start
|
22 | 143 |
|
23 | 144 | ### Creating a Tool
|
|
0 commit comments