blob: 48e747f99f3afda181dde422ee9bbd7b9739d0e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
---
allowed-tools: "Write, Edit, Bash(npm install*), Bash(npm init*), Read"
description: Set up a complete token-gated MCP server with FastMCP and Radius SDK
argument-hint: "[basic|full|testnet]"
---
## Setup Token-Gated MCP Server
Create a complete token-gated MCP server project with the specified configuration level:
- **basic**: Minimal setup with one protected tool
- **full**: Complete setup with multiple tiers and examples
- **testnet**: Configured for Radius Testnet deployment
Configuration: $ARGUMENTS
## Tasks
1. **Initialize Project**
- Create package.json with required dependencies
- Set up TypeScript configuration
- Create directory structure
2. **Install Dependencies**
```json
{
"dependencies": {
"fastmcp": "^3.0.0",
"@radiustechsystems/mcp-sdk": "^1.0.0",
"zod": "^3.22.0",
"viem": "^2.31.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"tsx": "^4.0.0",
"typescript": "^5.0.0",
"prettier": "^3.0.0"
}
}
```
3. **Create Server Implementation**
- Main server file with token protection
- Example tools with different token requirements
- Proper error handling and responses
4. **Environment Configuration**
- Create .env.example with required variables
- Set up for Radius Testnet (Chain ID: 1223953)
- Configure debug settings
5. **Create Helper Scripts**
- Development script with hot reload
- Build script for production
- Test script for auth flow validation
6. **Documentation**
- README with setup instructions
- Token tier documentation
- Testing guide with ngrok
## Implementation Structure
```text
project/
├── src/
│ ├── index.ts # Main server file
│ ├── tools/ # Tool implementations
│ ├── config/ # Configuration
│ └── types/ # Type definitions
├── .env.example # Environment template
├── package.json # Dependencies
├── tsconfig.json # TypeScript config
├── README.md # Documentation
└── .claude/ # Claude Code config
└── CLAUDE.md # Project context
```
Based on the configuration level ($ARGUMENTS), create the appropriate setup with working examples and clear documentation.
|