@yirifi-org/mcp-server 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +809 -0
- package/dist/client.d.ts +73 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +116 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +99 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/server-core.d.ts +73 -0
- package/dist/server-core.d.ts.map +1 -0
- package/dist/server-core.js +189 -0
- package/dist/server-core.js.map +1 -0
- package/dist/server-http.d.ts +17 -0
- package/dist/server-http.d.ts.map +1 -0
- package/dist/server-http.js +87 -0
- package/dist/server-http.js.map +1 -0
- package/dist/server-stdio.d.ts +13 -0
- package/dist/server-stdio.d.ts.map +1 -0
- package/dist/server-stdio.js +43 -0
- package/dist/server-stdio.js.map +1 -0
- package/dist/tools/executor.d.ts +24 -0
- package/dist/tools/executor.d.ts.map +1 -0
- package/dist/tools/executor.js +220 -0
- package/dist/tools/executor.js.map +1 -0
- package/dist/tools/filter.d.ts +82 -0
- package/dist/tools/filter.d.ts.map +1 -0
- package/dist/tools/filter.js +176 -0
- package/dist/tools/filter.js.map +1 -0
- package/dist/tools/generator.d.ts +45 -0
- package/dist/tools/generator.d.ts.map +1 -0
- package/dist/tools/generator.js +97 -0
- package/dist/tools/generator.js.map +1 -0
- package/package.json +66 -0
package/README.md
ADDED
|
@@ -0,0 +1,809 @@
|
|
|
1
|
+
# Yirifi MCP Server (TypeScript)
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server that provides Claude and other AI assistants with access to Yirifi's GRC platform external APIs. This enables AI-powered exploration of regulations, GRC knowledge base, vendor marketplace, and more.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
The Yirifi MCP server exposes 40+ tools organized across two main services:
|
|
9
|
+
|
|
10
|
+
- **RegDB Service**: Regulations, articles, organizations, and regulatory bodies
|
|
11
|
+
- **Web3GRC Service**: Knowledge base (categories, components, FAQs, glossary), marketplace (vendors, people), news, and templates
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- Comprehensive access to all Yirifi external APIs
|
|
16
|
+
- **Tool filtering** - Expose only the tools you need via `YIRIFI_TOOLS` env var
|
|
17
|
+
- **Type-safe input validation** with Zod schemas
|
|
18
|
+
- **Auto-generated JSON schemas** for MCP tool definitions from Zod
|
|
19
|
+
- Async/await architecture for optimal performance
|
|
20
|
+
- Modular code organization with clean separation of concerns
|
|
21
|
+
- Single base URL configuration for all services
|
|
22
|
+
- Detailed error messages for easy debugging
|
|
23
|
+
- Environment-based configuration
|
|
24
|
+
- Production-ready code quality with TypeScript strict mode
|
|
25
|
+
- Development watch mode with tsx
|
|
26
|
+
- Biome for fast linting and formatting
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
Before setting up the MCP server, ensure you have:
|
|
31
|
+
|
|
32
|
+
1. **Node.js 18 or higher** - Check with `node --version`
|
|
33
|
+
2. **Yarn package manager** - Install with `npm install -g yarn`
|
|
34
|
+
3. **Running Yirifi backend** - Services must be accessible (or use production URL)
|
|
35
|
+
4. **Yirifi API Key** - Generated from the Yirifi dashboard
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
### 1. Install Dependencies
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
yarn install
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This installs all required packages:
|
|
46
|
+
- `@modelcontextprotocol/sdk` - MCP protocol implementation
|
|
47
|
+
- `axios` - HTTP client for API requests
|
|
48
|
+
- `dotenv` - Environment variable management
|
|
49
|
+
- `zod` - TypeScript-first schema validation
|
|
50
|
+
- `zod-to-json-schema` - Convert Zod schemas to JSON Schema
|
|
51
|
+
- TypeScript and development tools
|
|
52
|
+
|
|
53
|
+
### 2. Create Environment Configuration
|
|
54
|
+
|
|
55
|
+
Create a `.env` file in the `mcp_server` directory:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
cp .env.example .env
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Edit `.env` and add your configuration:
|
|
62
|
+
|
|
63
|
+
```env
|
|
64
|
+
YIRIFI_API_KEY=your_api_key_here
|
|
65
|
+
YIRIFI_BASE_URL=https://dev-api.yirifi.ai
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Environment Variables:**
|
|
69
|
+
- `YIRIFI_API_KEY` - Your Yirifi API key (required)
|
|
70
|
+
- `YIRIFI_BASE_URL` - Base URL for Yirifi services (default: https://dev-api.yirifi.ai)
|
|
71
|
+
- `YIRIFI_TOOLS` - Tool filtering whitelist (optional, see [Tool Filtering](#tool-filtering))
|
|
72
|
+
|
|
73
|
+
## Tool Filtering
|
|
74
|
+
|
|
75
|
+
By default, all 37 tools are exposed. To reduce context window usage, you can filter which tools are available using the `YIRIFI_TOOLS` environment variable.
|
|
76
|
+
|
|
77
|
+
### Pattern Syntax
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Service-level wildcard (all tools from a service)
|
|
81
|
+
YIRIFI_TOOLS="regdb:*"
|
|
82
|
+
|
|
83
|
+
# Category-level wildcard
|
|
84
|
+
YIRIFI_TOOLS="web3grc:knowledge:*"
|
|
85
|
+
|
|
86
|
+
# Multiple patterns
|
|
87
|
+
YIRIFI_TOOLS="regdb:*,web3grc:knowledge:*"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Available Patterns
|
|
91
|
+
|
|
92
|
+
| Pattern | Description | Tools |
|
|
93
|
+
|---------|-------------|-------|
|
|
94
|
+
| `regdb:*` | All RegDB tools | 10 |
|
|
95
|
+
| `regdb:countries:*` | Country regulatory tools | 3 |
|
|
96
|
+
| `regdb:articles:*` | Article/regulation tools | 3 |
|
|
97
|
+
| `regdb:organizations:*` | Organization tools | 4 |
|
|
98
|
+
| `web3grc:*` | All Web3GRC tools | 27 |
|
|
99
|
+
| `web3grc:knowledge:*` | Knowledge base tools | 14 |
|
|
100
|
+
| `web3grc:marketplace:*` | Vendor/people marketplace | 9 |
|
|
101
|
+
| `web3grc:common:*` | News and templates | 4 |
|
|
102
|
+
|
|
103
|
+
### Example Configurations
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Only regulations research
|
|
107
|
+
YIRIFI_TOOLS="regdb:*"
|
|
108
|
+
|
|
109
|
+
# Only vendor comparison features
|
|
110
|
+
YIRIFI_TOOLS="web3grc_list_vendors,web3grc_get_vendor,web3grc_compare_vendors"
|
|
111
|
+
|
|
112
|
+
# Knowledge base + regulations
|
|
113
|
+
YIRIFI_TOOLS="regdb:articles:*,web3grc:knowledge:*"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Development
|
|
117
|
+
|
|
118
|
+
### Run in Development Mode
|
|
119
|
+
|
|
120
|
+
Watch mode with automatic rebuilds:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
yarn dev
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Build for Production
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
yarn build
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
This compiles TypeScript to JavaScript in the `dist/` directory.
|
|
133
|
+
|
|
134
|
+
### Run Production Build
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
yarn start
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Type Checking
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
yarn typecheck
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Linting and Formatting
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
yarn lint # Check code quality
|
|
150
|
+
yarn format # Format code
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Transport Modes
|
|
154
|
+
|
|
155
|
+
The server supports two transport modes:
|
|
156
|
+
|
|
157
|
+
| Mode | Use Case | API Key |
|
|
158
|
+
|------|----------|---------|
|
|
159
|
+
| **STDIO** | Claude Desktop integration | From `YIRIFI_API_KEY` env var |
|
|
160
|
+
| **HTTP** | Remote/Docker deployments | From `api-key` request header |
|
|
161
|
+
|
|
162
|
+
## Using with Claude Desktop (STDIO)
|
|
163
|
+
|
|
164
|
+
You can run the MCP server in three ways:
|
|
165
|
+
- **Method 1: Local Build** - Run the compiled server directly
|
|
166
|
+
- **Method 2: npm link** - Create a global symlink for local development
|
|
167
|
+
- **Method 3: GitHub via npx** - Run directly from GitHub repository
|
|
168
|
+
|
|
169
|
+
### Method 1: Run Locally (Recommended for Development)
|
|
170
|
+
|
|
171
|
+
#### 1. Build the Server
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
yarn build
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### 2. Configure Claude Desktop
|
|
178
|
+
|
|
179
|
+
Edit your Claude Desktop configuration file:
|
|
180
|
+
|
|
181
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
182
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
183
|
+
|
|
184
|
+
Add the server configuration:
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"mcpServers": {
|
|
189
|
+
"yirifi": {
|
|
190
|
+
"command": "node",
|
|
191
|
+
"args": [
|
|
192
|
+
"/absolute/path/to/yirifi-external-api-mcp/dist/server-stdio.js"
|
|
193
|
+
],
|
|
194
|
+
"env": {
|
|
195
|
+
"YIRIFI_API_KEY": "your_api_key_here",
|
|
196
|
+
"YIRIFI_BASE_URL": "https://dev-api.yirifi.ai",
|
|
197
|
+
"YIRIFI_TOOLS": "regdb:*,web3grc:knowledge:*"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
> **Tip:** Use `YIRIFI_TOOLS` to limit exposed tools and reduce context window usage. Omit it to expose all 37 tools.
|
|
205
|
+
|
|
206
|
+
**Important:**
|
|
207
|
+
- Use absolute paths
|
|
208
|
+
- Replace `/absolute/path/to/yirifi-external-api-mcp` with your actual path
|
|
209
|
+
- Set your actual API key
|
|
210
|
+
|
|
211
|
+
#### 3. Restart Claude Desktop
|
|
212
|
+
|
|
213
|
+
Quit and relaunch Claude Desktop for changes to take effect.
|
|
214
|
+
|
|
215
|
+
#### 4. Verify Installation
|
|
216
|
+
|
|
217
|
+
In Claude Desktop, you should see the Yirifi MCP server listed in the available tools. Try asking:
|
|
218
|
+
|
|
219
|
+
```
|
|
220
|
+
"Can you list all available countries in the Yirifi regulations database?"
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
### Method 2: Using npm link (For Local Development)
|
|
226
|
+
|
|
227
|
+
`npm link` creates a global symlink to your local package, allowing you to run the MCP server as if it were installed globally. This is ideal for development and testing.
|
|
228
|
+
|
|
229
|
+
#### 1. Build and Link the Package
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
cd /path/to/yirifi-backend/mcp_server
|
|
233
|
+
|
|
234
|
+
# Install dependencies and build
|
|
235
|
+
yarn install
|
|
236
|
+
yarn build
|
|
237
|
+
|
|
238
|
+
# Create global symlink
|
|
239
|
+
npm link
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
This creates a global symlink named `yirifi-mcp` (from the `bin` field in package.json).
|
|
243
|
+
|
|
244
|
+
#### 2. Verify the Link
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# Check the symlink was created
|
|
248
|
+
npm list -g --depth=0
|
|
249
|
+
|
|
250
|
+
# Test the command
|
|
251
|
+
yirifi-mcp --help
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
#### 3. Configure Claude Desktop
|
|
255
|
+
|
|
256
|
+
Edit your Claude Desktop configuration file:
|
|
257
|
+
|
|
258
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
259
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"mcpServers": {
|
|
264
|
+
"yirifi": {
|
|
265
|
+
"command": "yirifi-mcp",
|
|
266
|
+
"args": [],
|
|
267
|
+
"env": {
|
|
268
|
+
"YIRIFI_API_KEY": "your_api_key_here",
|
|
269
|
+
"YIRIFI_BASE_URL": "https://dev-api.yirifi.ai",
|
|
270
|
+
"YIRIFI_TOOLS": "regdb:*,web3grc:knowledge:*"
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
**Benefits of npm link:**
|
|
278
|
+
- ✅ Simple command name (no paths needed)
|
|
279
|
+
- ✅ Changes to source reflect after rebuild
|
|
280
|
+
- ✅ Works like a globally installed package
|
|
281
|
+
- ✅ Easy to share config with team members
|
|
282
|
+
|
|
283
|
+
**Development Workflow:**
|
|
284
|
+
```bash
|
|
285
|
+
# Make changes to source code
|
|
286
|
+
# Rebuild to update the linked package
|
|
287
|
+
yarn build
|
|
288
|
+
|
|
289
|
+
# Restart Claude Desktop to pick up changes
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
#### 4. Unlinking
|
|
293
|
+
|
|
294
|
+
To remove the global symlink:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
cd /path/to/yirifi-backend/mcp_server
|
|
298
|
+
npm unlink
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
### Method 3: Run from GitHub (Using npx)
|
|
304
|
+
|
|
305
|
+
This method allows you to run the MCP server directly from a GitHub repository without cloning it locally. Ideal for production or when you want to use a specific version/branch.
|
|
306
|
+
|
|
307
|
+
#### How It Works: The `prepare` Script
|
|
308
|
+
|
|
309
|
+
The `package.json` includes a `prepare` script that automatically builds the TypeScript code when installed from GitHub:
|
|
310
|
+
|
|
311
|
+
```json
|
|
312
|
+
{
|
|
313
|
+
"scripts": {
|
|
314
|
+
"prepare": "npm run build"
|
|
315
|
+
},
|
|
316
|
+
"bin": {
|
|
317
|
+
"yirifi-mcp": "dist/index.js"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
When `npx` installs the package from GitHub:
|
|
323
|
+
1. It clones/downloads the repository
|
|
324
|
+
2. Runs `npm install` to install dependencies
|
|
325
|
+
3. **Automatically runs the `prepare` script** which executes `npm run build`
|
|
326
|
+
4. The TypeScript is compiled to JavaScript in `dist/`
|
|
327
|
+
5. The `bin` entry makes `yirifi-mcp` executable
|
|
328
|
+
|
|
329
|
+
This means the package works directly from source without requiring pre-compiled files in the repository.
|
|
330
|
+
|
|
331
|
+
#### Prerequisites
|
|
332
|
+
|
|
333
|
+
1. **GitHub Repository**: Your code must be in a GitHub repository (public or private)
|
|
334
|
+
2. **GitHub Personal Access Token (PAT)**: Required for private repositories
|
|
335
|
+
|
|
336
|
+
#### Step 1: Create a GitHub Personal Access Token (PAT)
|
|
337
|
+
|
|
338
|
+
1. Go to **GitHub Settings** → **Developer settings** → **Personal access tokens** → **Tokens (classic)**
|
|
339
|
+
- Direct link: https://github.com/settings/tokens
|
|
340
|
+
|
|
341
|
+
2. Click **"Generate new token"** → **"Generate new token (classic)"**
|
|
342
|
+
|
|
343
|
+
3. Configure the token:
|
|
344
|
+
- **Note**: Give it a descriptive name (e.g., "Claude Desktop MCP Server")
|
|
345
|
+
- **Expiration**: Choose your preferred expiration (or "No expiration" for convenience)
|
|
346
|
+
- **Scopes**: Select these permissions:
|
|
347
|
+
- ✅ `repo` (Full control of private repositories) - if using private repo
|
|
348
|
+
- ✅ `read:org` (Read org and team membership) - optional, for org repos
|
|
349
|
+
|
|
350
|
+
4. Click **"Generate token"** at the bottom
|
|
351
|
+
|
|
352
|
+
5. **IMPORTANT**: Copy the token immediately! You won't be able to see it again.
|
|
353
|
+
- Format: `ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`
|
|
354
|
+
|
|
355
|
+
#### Step 2: Configure Claude Desktop with GitHub
|
|
356
|
+
|
|
357
|
+
Edit your Claude Desktop configuration file:
|
|
358
|
+
|
|
359
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
360
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
361
|
+
|
|
362
|
+
Add this configuration:
|
|
363
|
+
|
|
364
|
+
```json
|
|
365
|
+
{
|
|
366
|
+
"mcpServers": {
|
|
367
|
+
"yirifi-github": {
|
|
368
|
+
"command": "npx",
|
|
369
|
+
"args": [
|
|
370
|
+
"-y",
|
|
371
|
+
"github:your-org/yirifi-backend/mcp_server"
|
|
372
|
+
],
|
|
373
|
+
"env": {
|
|
374
|
+
"GITHUB_TOKEN": "ghp_your_github_personal_access_token_here",
|
|
375
|
+
"YIRIFI_API_KEY": "your_yirifi_api_key_here",
|
|
376
|
+
"YIRIFI_BASE_URL": "https://dev-api.yirifi.ai",
|
|
377
|
+
"YIRIFI_TOOLS": "regdb:*"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Configuration Parameters:**
|
|
385
|
+
|
|
386
|
+
- **`command: "npx"`** - Uses npx to run packages from GitHub
|
|
387
|
+
- **`args`**:
|
|
388
|
+
- `-y` - Automatically accept installation prompts
|
|
389
|
+
- `github:your-org/yirifi-backend/mcp_server` - GitHub repository path
|
|
390
|
+
- Format: `github:OWNER/REPO/SUBDIRECTORY`
|
|
391
|
+
- Example: `github:yirifi/yirifi-backend/mcp_server`
|
|
392
|
+
- Use subdirectory path if MCP server is not at repo root
|
|
393
|
+
|
|
394
|
+
- **`env`**:
|
|
395
|
+
- `GITHUB_TOKEN` - Your GitHub PAT (required for private repos)
|
|
396
|
+
- `YIRIFI_API_KEY` - Your Yirifi API key
|
|
397
|
+
- `YIRIFI_BASE_URL` - Yirifi API base URL
|
|
398
|
+
- `YIRIFI_TOOLS` - (Optional) Tool filtering pattern to reduce context usage
|
|
399
|
+
|
|
400
|
+
#### Step 3: Using Specific Branches or Commits
|
|
401
|
+
|
|
402
|
+
You can specify a particular branch, tag, or commit:
|
|
403
|
+
|
|
404
|
+
```json
|
|
405
|
+
{
|
|
406
|
+
"mcpServers": {
|
|
407
|
+
"yirifi-github-main": {
|
|
408
|
+
"command": "npx",
|
|
409
|
+
"args": [
|
|
410
|
+
"-y",
|
|
411
|
+
"github:your-org/yirifi-backend/mcp_server#main"
|
|
412
|
+
],
|
|
413
|
+
"env": { /* ... */ }
|
|
414
|
+
},
|
|
415
|
+
"yirifi-github-dev": {
|
|
416
|
+
"command": "npx",
|
|
417
|
+
"args": [
|
|
418
|
+
"-y",
|
|
419
|
+
"github:your-org/yirifi-backend/mcp_server#development"
|
|
420
|
+
],
|
|
421
|
+
"env": { /* ... */ }
|
|
422
|
+
},
|
|
423
|
+
"yirifi-github-tag": {
|
|
424
|
+
"command": "npx",
|
|
425
|
+
"args": [
|
|
426
|
+
"-y",
|
|
427
|
+
"github:your-org/yirifi-backend/mcp_server#v1.0.0"
|
|
428
|
+
],
|
|
429
|
+
"env": { /* ... */ }
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
**Branch/Tag/Commit Syntax:**
|
|
436
|
+
- `#main` - Use the main branch
|
|
437
|
+
- `#development` - Use the development branch
|
|
438
|
+
- `#v1.0.0` - Use a specific tag
|
|
439
|
+
- `#abc123` - Use a specific commit hash
|
|
440
|
+
|
|
441
|
+
#### Step 4: Restart Claude Desktop
|
|
442
|
+
|
|
443
|
+
Quit and completely restart Claude Desktop for the changes to take effect.
|
|
444
|
+
|
|
445
|
+
#### Step 5: Verify GitHub Installation
|
|
446
|
+
|
|
447
|
+
Check Claude Desktop logs to verify the server is running:
|
|
448
|
+
- **macOS**: `~/Library/Logs/Claude/mcp*.log`
|
|
449
|
+
- **Windows**: `%APPDATA%\Claude\logs\mcp*.log`
|
|
450
|
+
|
|
451
|
+
The server should download from GitHub and start automatically.
|
|
452
|
+
|
|
453
|
+
#### GitHub Method Benefits
|
|
454
|
+
|
|
455
|
+
✅ **Always up-to-date**: Pull latest changes by restarting Claude Desktop
|
|
456
|
+
✅ **No local setup**: No need to clone or build locally
|
|
457
|
+
✅ **Version control**: Pin to specific branches or tags
|
|
458
|
+
✅ **Multi-environment**: Run different versions simultaneously (dev/staging/prod)
|
|
459
|
+
✅ **Easy deployment**: Share configuration with team members
|
|
460
|
+
|
|
461
|
+
#### GitHub Method Considerations
|
|
462
|
+
|
|
463
|
+
⚠️ **First run is slower**: Downloads and builds from GitHub
|
|
464
|
+
⚠️ **Requires internet**: Must be online to download
|
|
465
|
+
⚠️ **GitHub rate limits**: May hit API limits if restarting frequently
|
|
466
|
+
⚠️ **PAT security**: Keep your GitHub token secure and don't commit it
|
|
467
|
+
|
|
468
|
+
#### Troubleshooting GitHub Method
|
|
469
|
+
|
|
470
|
+
**Server not starting:**
|
|
471
|
+
1. Verify your GitHub token is valid and has correct permissions
|
|
472
|
+
2. Check the repository path is correct (owner/repo/subdirectory)
|
|
473
|
+
3. Ensure the repository contains a valid `package.json`
|
|
474
|
+
4. Check Claude Desktop logs for detailed error messages
|
|
475
|
+
|
|
476
|
+
**Authentication errors:**
|
|
477
|
+
1. Regenerate your GitHub PAT if it expired
|
|
478
|
+
2. Verify `repo` scope is enabled for private repositories
|
|
479
|
+
3. Ensure token is correctly set in the `env.GITHUB_TOKEN` field
|
|
480
|
+
|
|
481
|
+
**Build errors:**
|
|
482
|
+
1. Verify the repository has all necessary build files (`package.json`, `tsconfig.json`)
|
|
483
|
+
2. Check that dependencies are correctly specified in `package.json`
|
|
484
|
+
3. Review Claude Desktop logs for specific build error messages
|
|
485
|
+
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
## Using with HTTP Transport (Remote/Docker)
|
|
489
|
+
|
|
490
|
+
The HTTP transport enables remote MCP server deployments, ideal for:
|
|
491
|
+
- Docker/Kubernetes deployments
|
|
492
|
+
- Shared team servers
|
|
493
|
+
- Multi-tenant scenarios (each client uses their own API key)
|
|
494
|
+
|
|
495
|
+
### Production Server
|
|
496
|
+
|
|
497
|
+
A production instance is available at:
|
|
498
|
+
|
|
499
|
+
**Base URL:** `https://mcp.yirifi.ai`
|
|
500
|
+
|
|
501
|
+
| Endpoint | Method | Description |
|
|
502
|
+
|----------|--------|-------------|
|
|
503
|
+
| `/` | GET | Server info and available endpoints |
|
|
504
|
+
| `/health` | GET | Health check (returns `{"status":"ok","tools":38}`) |
|
|
505
|
+
| `/mcp` | POST | MCP JSON-RPC endpoint |
|
|
506
|
+
|
|
507
|
+
### Running the HTTP Server Locally
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
# Development
|
|
511
|
+
yarn dev:http
|
|
512
|
+
|
|
513
|
+
# Production
|
|
514
|
+
yarn start:http
|
|
515
|
+
|
|
516
|
+
# Docker
|
|
517
|
+
docker-compose up --build
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
The server runs on port 8002 by default (configurable via `PORT` env var).
|
|
521
|
+
|
|
522
|
+
### Configuring Claude Desktop for HTTP
|
|
523
|
+
|
|
524
|
+
Edit your Claude Desktop configuration:
|
|
525
|
+
|
|
526
|
+
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
527
|
+
**Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
528
|
+
|
|
529
|
+
**Using Production Server (Recommended):**
|
|
530
|
+
```json
|
|
531
|
+
{
|
|
532
|
+
"mcpServers": {
|
|
533
|
+
"yirifi": {
|
|
534
|
+
"url": "https://mcp.yirifi.ai/mcp",
|
|
535
|
+
"headers": {
|
|
536
|
+
"api-key": "your_yirifi_api_key_here"
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
**Using Local Server:**
|
|
544
|
+
```json
|
|
545
|
+
{
|
|
546
|
+
"mcpServers": {
|
|
547
|
+
"yirifi-local": {
|
|
548
|
+
"url": "http://localhost:8002/mcp",
|
|
549
|
+
"headers": {
|
|
550
|
+
"api-key": "your_yirifi_api_key_here"
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
### Configuring Cursor for HTTP
|
|
558
|
+
|
|
559
|
+
In Cursor settings (`.cursor/mcp.json`), add MCP server configuration:
|
|
560
|
+
|
|
561
|
+
**Using Production Server:**
|
|
562
|
+
```json
|
|
563
|
+
{
|
|
564
|
+
"mcpServers": {
|
|
565
|
+
"yirifi": {
|
|
566
|
+
"url": "https://mcp.yirifi.ai/mcp",
|
|
567
|
+
"headers": {
|
|
568
|
+
"api-key": "your_yirifi_api_key_here"
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### Configuring Claude Code CLI for HTTP
|
|
576
|
+
|
|
577
|
+
Create or edit `.mcp.json` in your project root or home directory:
|
|
578
|
+
|
|
579
|
+
```json
|
|
580
|
+
{
|
|
581
|
+
"mcpServers": {
|
|
582
|
+
"yirifi": {
|
|
583
|
+
"type": "url",
|
|
584
|
+
"url": "https://mcp.yirifi.ai/mcp",
|
|
585
|
+
"headers": {
|
|
586
|
+
"api-key": "your_yirifi_api_key_here"
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### Testing the HTTP Server
|
|
594
|
+
|
|
595
|
+
**Local Server:**
|
|
596
|
+
```bash
|
|
597
|
+
# Server info
|
|
598
|
+
curl http://localhost:8002/
|
|
599
|
+
|
|
600
|
+
# Health check
|
|
601
|
+
curl http://localhost:8002/health
|
|
602
|
+
|
|
603
|
+
# List tools (MCP JSON-RPC)
|
|
604
|
+
curl -X POST http://localhost:8002/mcp \
|
|
605
|
+
-H "Content-Type: application/json" \
|
|
606
|
+
-H "Accept: application/json, text/event-stream" \
|
|
607
|
+
-H "api-key: YOUR_YIRIFI_API_KEY" \
|
|
608
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
|
|
609
|
+
|
|
610
|
+
# Call a tool
|
|
611
|
+
curl -X POST http://localhost:8002/mcp \
|
|
612
|
+
-H "Content-Type: application/json" \
|
|
613
|
+
-H "Accept: application/json, text/event-stream" \
|
|
614
|
+
-H "api-key: YOUR_YIRIFI_API_KEY" \
|
|
615
|
+
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"regdb_list_countries","arguments":{}},"id":2}'
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
**Production Server:**
|
|
619
|
+
```bash
|
|
620
|
+
# Server info
|
|
621
|
+
curl https://mcp.yirifi.ai/
|
|
622
|
+
|
|
623
|
+
# Health check
|
|
624
|
+
curl https://mcp.yirifi.ai/health
|
|
625
|
+
|
|
626
|
+
# List tools (MCP JSON-RPC)
|
|
627
|
+
curl -X POST https://mcp.yirifi.ai/mcp \
|
|
628
|
+
-H "Content-Type: application/json" \
|
|
629
|
+
-H "Accept: application/json, text/event-stream" \
|
|
630
|
+
-H "api-key: YOUR_YIRIFI_API_KEY" \
|
|
631
|
+
-d '{"jsonrpc":"2.0","method":"tools/list","id":1}'
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
### Docker Deployment
|
|
635
|
+
|
|
636
|
+
```bash
|
|
637
|
+
# Build and run
|
|
638
|
+
docker-compose up --build
|
|
639
|
+
|
|
640
|
+
# Run in background
|
|
641
|
+
docker-compose up -d
|
|
642
|
+
|
|
643
|
+
# View logs
|
|
644
|
+
docker-compose logs -f
|
|
645
|
+
|
|
646
|
+
# Stop
|
|
647
|
+
docker-compose down
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
Environment variables for Docker (set in `.env` or docker-compose):
|
|
651
|
+
- `PORT` - Server port (default: 8002)
|
|
652
|
+
- `YIRIFI_BASE_URL` - Yirifi API base URL
|
|
653
|
+
- `YIRIFI_TOOLS` - Tool filtering patterns
|
|
654
|
+
- `YIRIFI_DEFER_TOOLS` - Deferred tool patterns
|
|
655
|
+
|
|
656
|
+
### Deploying to Production
|
|
657
|
+
|
|
658
|
+
Use the included deploy script to deploy to the production server:
|
|
659
|
+
|
|
660
|
+
```bash
|
|
661
|
+
# Full deploy
|
|
662
|
+
./deploy.sh
|
|
663
|
+
|
|
664
|
+
# View logs
|
|
665
|
+
./deploy.sh --logs
|
|
666
|
+
|
|
667
|
+
# Check status
|
|
668
|
+
./deploy.sh --status
|
|
669
|
+
|
|
670
|
+
# Quick restart (no rebuild)
|
|
671
|
+
./deploy.sh --skip-build
|
|
672
|
+
|
|
673
|
+
# Fresh build (no cache)
|
|
674
|
+
./deploy.sh --no-cache
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
## Available Tools
|
|
680
|
+
|
|
681
|
+
The server provides 40+ tools across different domains:
|
|
682
|
+
|
|
683
|
+
### RegDB Tools (10 tools)
|
|
684
|
+
- **Countries**: `regdb_list_countries`, `regdb_filter_country_regulatory`, `regdb_list_regulatory_groups`
|
|
685
|
+
- **Articles**: `regdb_filter_articles`, `regdb_get_article`, `regdb_get_article_tags`
|
|
686
|
+
- **Organizations**: `regdb_list_organizations`, `regdb_get_organization`, `regdb_list_regulatory_bodies`, `regdb_list_organization_types`
|
|
687
|
+
|
|
688
|
+
### Web3GRC Knowledge Base (14 tools)
|
|
689
|
+
- **Categories**: `web3grc_list_categories`, `web3grc_get_category`
|
|
690
|
+
- **Components**: `web3grc_list_components`, `web3grc_get_component`
|
|
691
|
+
- **Features**: `web3grc_list_features`, `web3grc_list_feature_categories`
|
|
692
|
+
- **Glossary**: `web3grc_list_glossary`, `web3grc_get_glossary_term`
|
|
693
|
+
- **Questions**: `web3grc_list_questions`, `web3grc_get_question`
|
|
694
|
+
- **FAQs**: `web3grc_list_faqs`, `web3grc_get_faq`
|
|
695
|
+
- **Solutions**: `web3grc_list_solutions`, `web3grc_get_solution`
|
|
696
|
+
|
|
697
|
+
### Web3GRC Marketplace (9 tools)
|
|
698
|
+
- **People**: `web3grc_list_people`, `web3grc_get_person`
|
|
699
|
+
- **Vendors**: `web3grc_list_vendors`, `web3grc_get_vendor`, `web3grc_get_vendors_by_usecase`, `web3grc_get_vendor_components`, `web3grc_compare_vendors`, `web3grc_get_vendor_solutions`, `web3grc_get_vendor_locations`
|
|
700
|
+
|
|
701
|
+
### Web3GRC Common Resources (4 tools)
|
|
702
|
+
- **News**: `web3grc_list_news`, `web3grc_get_news`
|
|
703
|
+
- **Templates**: `web3grc_list_templates`, `web3grc_get_template`
|
|
704
|
+
|
|
705
|
+
## Project Structure
|
|
706
|
+
|
|
707
|
+
```
|
|
708
|
+
mcp_server/
|
|
709
|
+
├── src/
|
|
710
|
+
│ ├── client.ts # HTTP client for Yirifi APIs
|
|
711
|
+
│ ├── config.ts # Configuration and environment loading
|
|
712
|
+
│ ├── index.ts # CLI entry point (STDIO)
|
|
713
|
+
│ ├── server-core.ts # Shared MCP server logic
|
|
714
|
+
│ ├── server-stdio.ts # STDIO transport entry point
|
|
715
|
+
│ ├── server-http.ts # HTTP transport entry point
|
|
716
|
+
│ └── tools/
|
|
717
|
+
│ ├── filter.ts # Tool filtering utility
|
|
718
|
+
│ ├── generator.ts # OpenAPI → MCP tool generator
|
|
719
|
+
│ └── executor.ts # Generic tool executor
|
|
720
|
+
├── dist/ # Compiled JavaScript (generated)
|
|
721
|
+
├── Dockerfile # Docker image for HTTP server
|
|
722
|
+
├── docker-compose.yml # Docker Compose configuration
|
|
723
|
+
├── package.json
|
|
724
|
+
├── tsconfig.json
|
|
725
|
+
├── biome.json
|
|
726
|
+
└── .env # Your environment config (create this)
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
## Troubleshooting
|
|
730
|
+
|
|
731
|
+
### "Cannot find module" errors
|
|
732
|
+
|
|
733
|
+
Make sure you've built the project:
|
|
734
|
+
```bash
|
|
735
|
+
yarn build
|
|
736
|
+
```
|
|
737
|
+
|
|
738
|
+
### TypeScript errors
|
|
739
|
+
|
|
740
|
+
Run type checking to see detailed errors:
|
|
741
|
+
```bash
|
|
742
|
+
yarn typecheck
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
### Environment variable not loaded
|
|
746
|
+
|
|
747
|
+
1. Verify `.env` file exists in the `mcp_server` directory
|
|
748
|
+
2. Check that variable names match exactly (case-sensitive)
|
|
749
|
+
3. Restart the server after changing `.env`
|
|
750
|
+
|
|
751
|
+
### Server not appearing in Claude Desktop
|
|
752
|
+
|
|
753
|
+
1. Check Claude Desktop config syntax is valid JSON
|
|
754
|
+
2. Use absolute paths (not relative paths with ~)
|
|
755
|
+
3. Verify the `dist/server-stdio.js` file exists (for STDIO) or server is running (for HTTP)
|
|
756
|
+
4. Check logs in Claude Desktop (Help → View Logs)
|
|
757
|
+
5. Restart Claude Desktop completely
|
|
758
|
+
|
|
759
|
+
## API Examples
|
|
760
|
+
|
|
761
|
+
### List Countries
|
|
762
|
+
```typescript
|
|
763
|
+
// Tool: regdb_list_countries
|
|
764
|
+
{
|
|
765
|
+
"page": 1,
|
|
766
|
+
"limit": 10,
|
|
767
|
+
"region": "Europe"
|
|
768
|
+
}
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
### Search Articles
|
|
772
|
+
```typescript
|
|
773
|
+
// Tool: regdb_filter_articles
|
|
774
|
+
{
|
|
775
|
+
"query": "GDPR",
|
|
776
|
+
"country": "european-union",
|
|
777
|
+
"limit": 20
|
|
778
|
+
}
|
|
779
|
+
```
|
|
780
|
+
|
|
781
|
+
### Get Vendor Information
|
|
782
|
+
```typescript
|
|
783
|
+
// Tool: web3grc_get_vendor
|
|
784
|
+
{
|
|
785
|
+
"identifier": "vendor-slug-or-id"
|
|
786
|
+
}
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
## Contributing
|
|
790
|
+
|
|
791
|
+
When contributing to the TypeScript version:
|
|
792
|
+
|
|
793
|
+
1. Follow existing code style (Biome enforces this)
|
|
794
|
+
2. Add Zod schemas for new API inputs
|
|
795
|
+
3. Update tool descriptions when adding features
|
|
796
|
+
4. Run `yarn typecheck` before committing
|
|
797
|
+
5. Run `yarn format` to auto-format code
|
|
798
|
+
|
|
799
|
+
## License
|
|
800
|
+
|
|
801
|
+
UNLICENSED - Private Yirifi project
|
|
802
|
+
|
|
803
|
+
## Support
|
|
804
|
+
|
|
805
|
+
For issues or questions:
|
|
806
|
+
- Check existing documentation files
|
|
807
|
+
- Review Claude Desktop logs
|
|
808
|
+
- Verify API key and network connectivity
|
|
809
|
+
- Ensure Yirifi backend services are running
|