Skip to content

Commit 752024e

Browse files
committed
feat: add readme
1 parent 91101ee commit 752024e

File tree

1 file changed

+86
-19
lines changed

1 file changed

+86
-19
lines changed

README.md

+86-19
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,94 @@ Get started fast with mcp-framework ⚡⚡⚡
77
## Features
88

99
- 🛠️ Automatic directory-based discovery and loading for tools, prompts, and resources
10-
- 🏗️ Powerful abstractions
10+
- 🏗️ Powerful abstractions with full type safety
1111
- 🚀 Simple server setup and configuration
12+
- 📦 CLI for rapid development and project scaffolding
1213

13-
## Installation
14+
## Quick Start
15+
16+
### Using the CLI (Recommended)
17+
18+
```bash
19+
# Install the framework globally
20+
npm install -g mcp-framework
21+
22+
# Create a new MCP server project
23+
mcp create my-mcp-server
24+
25+
# Navigate to your project
26+
cd my-mcp-server
27+
28+
# Your server is ready to use!
29+
```
30+
31+
### Manual Installation
1432

1533
```bash
1634
npm install mcp-framework
1735
```
1836

19-
## Quick Start
37+
## CLI Usage
2038

21-
### 1. Create your MCP server:
39+
The framework provides a powerful CLI for managing your MCP server projects:
2240

23-
```typescript
24-
import { MCPServer } from "mcp-framework";
41+
### Project Creation
42+
43+
```bash
44+
# Create a new project
45+
mcp create <your project name here>
46+
```
2547

26-
const server = new MCPServer();
48+
### Adding a Tool
2749

28-
server.start().catch((error) => {
29-
console.error("Server failed to start:", error);
30-
process.exit(1);
31-
});
50+
```bash
51+
# Add a new tool
52+
mcp add tool price-fetcher
3253
```
3354

34-
### 2. Create a Tool:
55+
### Adding a Prompt
56+
57+
```bash
58+
# Add a new prompt
59+
mcp add prompt price-analysis
60+
```
61+
62+
### Adding a Resource
63+
64+
```bash
65+
# Add a new prompt
66+
mcp add resource market-data
67+
```
68+
69+
## Development Workflow
70+
71+
1. Create your project:
72+
73+
```bash
74+
mcp create my-mcp-server
75+
cd my-mcp-server
76+
```
77+
78+
2. Add tools as needed:
79+
80+
```bash
81+
mcp add tool data-fetcher
82+
mcp add tool data-processor
83+
mcp add tool report-generator
84+
```
85+
86+
3. Build and run:
87+
```bash
88+
npm run build
89+
# or
90+
npm run watch # for development
91+
```
92+
93+
## Components Overview
94+
95+
### 1. Tools (Main Component)
96+
97+
Tools are the primary way to extend an LLM's capabilities. Each tool should perform a specific function:
3598

3699
```typescript
37100
import { MCPTool } from "mcp-framework";
@@ -60,7 +123,9 @@ class ExampleTool extends MCPTool<ExampleInput> {
60123
export default ExampleTool;
61124
```
62125

63-
### 3. Create a Prompt:
126+
### 2. Prompts (Optional)
127+
128+
Prompts help structure conversations with Claude:
64129

65130
```typescript
66131
import { MCPPrompt } from "mcp-framework";
@@ -104,7 +169,9 @@ class GreetingPrompt extends MCPPrompt<GreetingInput> {
104169
export default GreetingPrompt;
105170
```
106171

107-
### 4. Create a Resource:
172+
### 3. Resources (Optional)
173+
174+
Resources provide data access capabilities:
108175

109176
```typescript
110177
import { MCPResource, ResourceContent } from "mcp-framework";
@@ -139,11 +206,11 @@ export default ConfigResource;
139206
```
140207
your-project/
141208
├── src/
142-
│ ├── tools/ # Tool implementations
209+
│ ├── tools/ # Tool implementations (Required)
143210
│ │ └── ExampleTool.ts
144-
│ ├── prompts/ # Prompt implementations
211+
│ ├── prompts/ # Prompt implementations (Optional)
145212
│ │ └── GreetingPrompt.ts
146-
│ ├── resources/ # Resource implementations
213+
│ ├── resources/ # Resource implementations (Optional)
147214
│ │ └── ConfigResource.ts
148215
│ └── index.ts
149216
├── package.json
@@ -155,8 +222,8 @@ your-project/
155222
The framework automatically discovers and loads:
156223

157224
- Tools from the `src/tools` directory
158-
- Prompts from the `src/prompts` directory
159-
- Resources from the `src/resources` directory
225+
- Prompts from the `src/prompts` directory (if present)
226+
- Resources from the `src/resources` directory (if present)
160227

161228
Each feature should be in its own file and export a default class that extends the appropriate base class:
162229

0 commit comments

Comments
 (0)