fa-mcp-sdk 0.4.74 → 0.4.77
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/README.md +319 -314
- package/bin/fa-mcp.js +85 -68
- package/cli-template/.claude/agents/javascript-pro.md +276 -276
- package/cli-template/.claude/settings.json +50 -50
- package/cli-template/.claude/skills/mcp-app-add-to-server/SKILL.md +427 -0
- package/cli-template/.claude/skills/mcp-app-create/SKILL.md +222 -0
- package/cli-template/.claude/skills/upgrade-guide/SKILL.md +2 -1
- package/cli-template/.oxfmtrc.json +41 -0
- package/cli-template/.oxlintrc.json +120 -0
- package/cli-template/CLAUDE.md +358 -355
- package/cli-template/FA-MCP-SDK-DOC/00-FA-MCP-SDK-index.md +132 -132
- package/cli-template/FA-MCP-SDK-DOC/01-getting-started.md +146 -146
- package/cli-template/FA-MCP-SDK-DOC/02-1-tools-and-api.md +431 -431
- package/cli-template/FA-MCP-SDK-DOC/02-2-prompts-and-resources.md +201 -201
- package/cli-template/FA-MCP-SDK-DOC/03-configuration.md +384 -384
- package/cli-template/FA-MCP-SDK-DOC/04-authentication.md +412 -412
- package/cli-template/FA-MCP-SDK-DOC/05-ad-authorization.md +196 -196
- package/cli-template/FA-MCP-SDK-DOC/06-utilities.md +163 -163
- package/cli-template/FA-MCP-SDK-DOC/07-testing-and-operations.md +127 -127
- package/cli-template/FA-MCP-SDK-DOC/08-agent-tester-and-headless-api.md +681 -659
- package/cli-template/README.md +193 -191
- package/cli-template/jest.config.js +27 -30
- package/cli-template/package.json +10 -5
- package/cli-template/prompt-example-new-MCP.md +101 -101
- package/cli-template/readme-docs/SKILLS.md +86 -1
- package/cli-template/tsconfig.json +58 -58
- package/cli-template/update.cjs +41 -38
- package/config/custom-environment-variables.yaml +63 -63
- package/config/development.yaml +4 -4
- package/config/production.yaml +4 -4
- package/config/test.yaml +26 -26
- package/dist/core/_types_/TNtlm.d.ts.map +1 -1
- package/dist/core/_types_/active-directory-config.d.ts.map +1 -1
- package/dist/core/_types_/config.d.ts.map +1 -1
- package/dist/core/_types_/types.d.ts.map +1 -1
- package/dist/core/ad/group-checker.d.ts.map +1 -1
- package/dist/core/ad/group-checker.js.map +1 -1
- package/dist/core/agent-tester/agent-tester-router.d.ts.map +1 -1
- package/dist/core/agent-tester/agent-tester-router.js +6 -6
- package/dist/core/agent-tester/agent-tester-router.js.map +1 -1
- package/dist/core/agent-tester/check-llm.d.ts.map +1 -1
- package/dist/core/agent-tester/check-llm.js.map +1 -1
- package/dist/core/agent-tester/services/SummaryMemory.d.ts.map +1 -1
- package/dist/core/agent-tester/services/SummaryMemory.js +3 -9
- package/dist/core/agent-tester/services/SummaryMemory.js.map +1 -1
- package/dist/core/agent-tester/services/TesterAgentService.d.ts.map +1 -1
- package/dist/core/agent-tester/services/TesterAgentService.js +25 -27
- package/dist/core/agent-tester/services/TesterAgentService.js.map +1 -1
- package/dist/core/agent-tester/services/TesterMcpClientService.d.ts.map +1 -1
- package/dist/core/agent-tester/services/TesterMcpClientService.js +26 -25
- package/dist/core/agent-tester/services/TesterMcpClientService.js.map +1 -1
- package/dist/core/auth/admin-auth.d.ts.map +1 -1
- package/dist/core/auth/admin-auth.js +5 -5
- package/dist/core/auth/admin-auth.js.map +1 -1
- package/dist/core/auth/agent-tester-auth.d.ts.map +1 -1
- package/dist/core/auth/agent-tester-auth.js +1 -6
- package/dist/core/auth/agent-tester-auth.js.map +1 -1
- package/dist/core/auth/basic.d.ts.map +1 -1
- package/dist/core/auth/basic.js.map +1 -1
- package/dist/core/auth/ip-check.d.ts.map +1 -1
- package/dist/core/auth/ip-check.js +1 -1
- package/dist/core/auth/ip-check.js.map +1 -1
- package/dist/core/auth/jwt.d.ts.map +1 -1
- package/dist/core/auth/jwt.js +1 -1
- package/dist/core/auth/jwt.js.map +1 -1
- package/dist/core/auth/middleware.d.ts.map +1 -1
- package/dist/core/auth/middleware.js +9 -6
- package/dist/core/auth/middleware.js.map +1 -1
- package/dist/core/auth/multi-auth.d.ts.map +1 -1
- package/dist/core/auth/multi-auth.js +6 -6
- package/dist/core/auth/multi-auth.js.map +1 -1
- package/dist/core/auth/revocation.d.ts.map +1 -1
- package/dist/core/auth/revocation.js +2 -6
- package/dist/core/auth/revocation.js.map +1 -1
- package/dist/core/auth/token-generator/ntlm/ntlm-auth-options.d.ts.map +1 -1
- package/dist/core/auth/token-generator/ntlm/ntlm-auth-options.js +2 -2
- package/dist/core/auth/token-generator/ntlm/ntlm-auth-options.js.map +1 -1
- package/dist/core/auth/token-generator/ntlm/ntlm-domain-config.js +1 -1
- package/dist/core/auth/token-generator/ntlm/ntlm-domain-config.js.map +1 -1
- package/dist/core/auth/token-generator/ntlm/ntlm-integration.d.ts.map +1 -1
- package/dist/core/auth/token-generator/ntlm/ntlm-integration.js +4 -2
- package/dist/core/auth/token-generator/ntlm/ntlm-integration.js.map +1 -1
- package/dist/core/auth/token-generator/server.d.ts.map +1 -1
- package/dist/core/auth/token-generator/server.js.map +1 -1
- package/dist/core/bootstrap/init-config.d.ts.map +1 -1
- package/dist/core/bootstrap/init-config.js +2 -2
- package/dist/core/bootstrap/init-config.js.map +1 -1
- package/dist/core/bootstrap/startup-info.d.ts.map +1 -1
- package/dist/core/bootstrap/startup-info.js +3 -7
- package/dist/core/bootstrap/startup-info.js.map +1 -1
- package/dist/core/cache/cache.d.ts.map +1 -1
- package/dist/core/cache/cache.js +2 -2
- package/dist/core/cache/cache.js.map +1 -1
- package/dist/core/consul/deregister.d.ts.map +1 -1
- package/dist/core/consul/deregister.js.map +1 -1
- package/dist/core/consul/get-consul-api.d.ts.map +1 -1
- package/dist/core/consul/get-consul-api.js +1 -2
- package/dist/core/consul/get-consul-api.js.map +1 -1
- package/dist/core/db/pg-db.d.ts.map +1 -1
- package/dist/core/db/pg-db.js +3 -3
- package/dist/core/db/pg-db.js.map +1 -1
- package/dist/core/debug.d.ts.map +1 -1
- package/dist/core/debug.js.map +1 -1
- package/dist/core/errors/BaseMcpError.d.ts.map +1 -1
- package/dist/core/errors/BaseMcpError.js.map +1 -1
- package/dist/core/errors/ValidationError.d.ts.map +1 -1
- package/dist/core/errors/ValidationError.js.map +1 -1
- package/dist/core/errors/errors.d.ts.map +1 -1
- package/dist/core/errors/errors.js +1 -1
- package/dist/core/errors/errors.js.map +1 -1
- package/dist/core/index.d.ts +6 -6
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +5 -5
- package/dist/core/index.js.map +1 -1
- package/dist/core/init-mcp-server.d.ts.map +1 -1
- package/dist/core/init-mcp-server.js.map +1 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +1 -1
- package/dist/core/logger.js.map +1 -1
- package/dist/core/mcp/create-mcp-server.d.ts.map +1 -1
- package/dist/core/mcp/create-mcp-server.js +1 -1
- package/dist/core/mcp/create-mcp-server.js.map +1 -1
- package/dist/core/mcp/prompts.d.ts.map +1 -1
- package/dist/core/mcp/prompts.js.map +1 -1
- package/dist/core/mcp/readme-assembler.d.ts.map +1 -1
- package/dist/core/mcp/readme-assembler.js +3 -1
- package/dist/core/mcp/readme-assembler.js.map +1 -1
- package/dist/core/mcp/resources.d.ts.map +1 -1
- package/dist/core/mcp/resources.js.map +1 -1
- package/dist/core/mcp/server-stdio.d.ts.map +1 -1
- package/dist/core/utils/formatToolResult.d.ts.map +1 -1
- package/dist/core/utils/formatToolResult.js.map +1 -1
- package/dist/core/utils/port-checker.d.ts.map +1 -1
- package/dist/core/utils/port-checker.js.map +1 -1
- package/dist/core/utils/rate-limit.d.ts.map +1 -1
- package/dist/core/utils/rate-limit.js +2 -8
- package/dist/core/utils/rate-limit.js.map +1 -1
- package/dist/core/utils/testing/BaseMcpClient.d.ts.map +1 -1
- package/dist/core/utils/testing/BaseMcpClient.js.map +1 -1
- package/dist/core/utils/testing/McpHttpClient.d.ts.map +1 -1
- package/dist/core/utils/testing/McpHttpClient.js +2 -2
- package/dist/core/utils/testing/McpHttpClient.js.map +1 -1
- package/dist/core/utils/testing/McpSseClient.d.ts.map +1 -1
- package/dist/core/utils/testing/McpSseClient.js +3 -8
- package/dist/core/utils/testing/McpSseClient.js.map +1 -1
- package/dist/core/utils/testing/McpStdioClient.d.ts.map +1 -1
- package/dist/core/utils/testing/McpStdioClient.js.map +1 -1
- package/dist/core/utils/testing/McpStreamableHttpClient.d.ts.map +1 -1
- package/dist/core/utils/testing/McpStreamableHttpClient.js +7 -8
- package/dist/core/utils/testing/McpStreamableHttpClient.js.map +1 -1
- package/dist/core/utils/utils.d.ts.map +1 -1
- package/dist/core/utils/utils.js +3 -5
- package/dist/core/utils/utils.js.map +1 -1
- package/dist/core/web/admin-router.d.ts.map +1 -1
- package/dist/core/web/admin-router.js +3 -3
- package/dist/core/web/admin-router.js.map +1 -1
- package/dist/core/web/cors.d.ts.map +1 -1
- package/dist/core/web/cors.js.map +1 -1
- package/dist/core/web/favicon-svg.d.ts.map +1 -1
- package/dist/core/web/favicon-svg.js +1 -5
- package/dist/core/web/favicon-svg.js.map +1 -1
- package/dist/core/web/home-api.d.ts.map +1 -1
- package/dist/core/web/home-api.js +7 -8
- package/dist/core/web/home-api.js.map +1 -1
- package/dist/core/web/openapi.d.ts.map +1 -1
- package/dist/core/web/openapi.js +1 -3
- package/dist/core/web/openapi.js.map +1 -1
- package/dist/core/web/server-http.d.ts.map +1 -1
- package/dist/core/web/server-http.js +4 -4
- package/dist/core/web/server-http.js.map +1 -1
- package/dist/core/web/static/agent-tester/index.html +323 -323
- package/dist/core/web/static/agent-tester/script.js +311 -200
- package/dist/core/web/static/agent-tester/styles.css +1840 -1840
- package/dist/core/web/static/home/index.html +220 -220
- package/dist/core/web/static/home/script.js +72 -43
- package/dist/core/web/static/styles.css +927 -927
- package/dist/core/web/static/token-gen/index.html +136 -136
- package/dist/core/web/static/token-gen/script.js +58 -56
- package/dist/core/web/svg-icons.d.ts.map +1 -1
- package/dist/core/web/svg-icons.js +1 -5
- package/dist/core/web/svg-icons.js.map +1 -1
- package/package.json +10 -5
- package/{cli-template/.claude/hooks/eslint-fix.cjs → scripts/cc-hook-oxlint-oxfmt-fix.cjs} +109 -100
- package/scripts/generate-jwt.js +5 -9
- package/scripts/kill-port.js +5 -2
- package/scripts/npm/run.js +1 -2
- package/scripts/remove-nul.js +1 -1
- package/scripts/update-sdk.js +36 -14
- package/src/template/api/router.ts +3 -3
- package/src/template/prompts/agent-brief.ts +0 -1
- package/src/template/start.ts +3 -8
- package/src/template/tools/handle-tool-call.ts +3 -3
- package/src/template/tools/tools.ts +3 -7
- package/src/tests/jest-simple-reporter.js +1 -1
- package/src/tests/mcp/sse/mcp-sse-client-handling.md +111 -111
- package/src/tests/mcp/sse/test-sse-npm-package.js +2 -3
- package/src/tests/mcp/test-cases.js +6 -7
- package/src/tests/mcp/test-http.js +2 -2
- package/src/tests/mcp/test-sse.js +9 -7
- package/src/tests/mcp/test-stdio.js +12 -8
- package/src/tests/utils.ts +4 -3
- package/cli-template/eslint.config.js +0 -27
package/cli-template/README.md
CHANGED
|
@@ -1,191 +1,193 @@
|
|
|
1
|
-
# {{project.productName}}
|
|
2
|
-
|
|
3
|
-
{{project.description}}
|
|
4
|
-
|
|
5
|
-
## Install & Run
|
|
6
|
-
|
|
7
|
-
### Quick Start
|
|
8
|
-
```bash
|
|
9
|
-
# Install
|
|
10
|
-
npm install
|
|
11
|
-
|
|
12
|
-
# Configure (copy config/local.yaml from config/_local.yaml)
|
|
13
|
-
# Add database credentials
|
|
14
|
-
|
|
15
|
-
# Build
|
|
16
|
-
npm run build
|
|
17
|
-
|
|
18
|
-
# Run (STDIO mode for Claude Desktop)
|
|
19
|
-
npm start
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Test Run
|
|
23
|
-
```bash
|
|
24
|
-
# Unit tests
|
|
25
|
-
npm test
|
|
26
|
-
|
|
27
|
-
# MCP protocol tests
|
|
28
|
-
npm run test:mcp # STDIO mode
|
|
29
|
-
npm run test:mcp-http # HTTP mode
|
|
30
|
-
npm run test:mcp-simple # Simple test
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### Dual Transport System
|
|
34
|
-
|
|
35
|
-
**STDIO Mode** (default for Claude Desktop):
|
|
36
|
-
- Direct stdin/stdout communication
|
|
37
|
-
- Optimal for Claude Desktop integration
|
|
38
|
-
- No network ports required
|
|
39
|
-
|
|
40
|
-
**HTTP Mode** (web integration):
|
|
41
|
-
- HTTP server with Server-Sent Events (SSE)
|
|
42
|
-
- Home page with server status at `http://localhost:{{port}}/`
|
|
43
|
-
- Health check endpoint at `/health`
|
|
44
|
-
- Direct JSON-RPC 2.0 endpoint at `/mcp`
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Features
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
## MCP Tools
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
## MCP Prompts
|
|
56
|
-
|
|
57
|
-
### `agent_brief`
|
|
58
|
-
Brief description of agent capabilities for agent selection.
|
|
59
|
-
|
|
60
|
-
### `agent_prompt`
|
|
61
|
-
Complete prompt with instructions.
|
|
62
|
-
|
|
63
|
-
## MCP Resources
|
|
64
|
-
|
|
65
|
-
### `staff://agent/brief`
|
|
66
|
-
Same as `agent_brief` prompt. **MIME:** text/plain
|
|
67
|
-
|
|
68
|
-
### `staff://agent/prompt`
|
|
69
|
-
Same as `agent_prompt` prompt. **MIME:** text/plain
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## 2. Configuration
|
|
73
|
-
|
|
74
|
-
**Option A: Configuration File**
|
|
75
|
-
|
|
76
|
-
**Option B: Environment Variables**
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## Usage with AI CLIs
|
|
80
|
-
|
|
81
|
-
The server exposes an HTTP MCP endpoint at `http[s]://<host[:port]>/mcp`. Authentication (when enabled in
|
|
82
|
-
`config/default.yaml` → `webServer.auth`) is passed via the standard `Authorization` header — most commonly a
|
|
83
|
-
JWT Bearer token generated by the `/gen-jwt` skill or by `node scripts/generate-jwt.js`.
|
|
84
|
-
|
|
85
|
-
### With Claude Code
|
|
86
|
-
|
|
87
|
-
Add to `~\.claude.json`:
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"mcpServers": {
|
|
92
|
-
"{{project.name}}": {
|
|
93
|
-
"type": "http",
|
|
94
|
-
"url": "http[s]://<host[:port]>/mcp",
|
|
95
|
-
"headers": {
|
|
96
|
-
"Authorization": "Bearer <jwt-token>"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### With Claude Desktop
|
|
104
|
-
|
|
105
|
-
Add to your Claude Desktop configuration (`claude_desktop_config.json`):
|
|
106
|
-
|
|
107
|
-
```json
|
|
108
|
-
{
|
|
109
|
-
"mcpServers": {
|
|
110
|
-
"{{project.name}}": {
|
|
111
|
-
"command": "npx",
|
|
112
|
-
"args": [
|
|
113
|
-
"-y",
|
|
114
|
-
"mcp-remote@latest",
|
|
115
|
-
"http[s]://<host[:port]>/mcp",
|
|
116
|
-
"--header",
|
|
117
|
-
"Authorization: Bearer <jwt-token>",
|
|
118
|
-
"--allow-http",
|
|
119
|
-
"--transport",
|
|
120
|
-
"http-only"
|
|
121
|
-
]
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### With Qwen Code
|
|
128
|
-
|
|
129
|
-
Add to `~\.qwen\settings.json`:
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"mcpServers": {
|
|
134
|
-
"{{project.name}}": {
|
|
135
|
-
"command": "npx",
|
|
136
|
-
"args": [
|
|
137
|
-
"-y",
|
|
138
|
-
"mcp-remote@latest",
|
|
139
|
-
"http[s]://<host[:port]>/mcp",
|
|
140
|
-
"--header",
|
|
141
|
-
"Authorization: Bearer <jwt-token>",
|
|
142
|
-
"--allow-http",
|
|
143
|
-
"--transport",
|
|
144
|
-
"http-only"
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
> For STDIO transport (local Claude Desktop integration without an HTTP server), run
|
|
152
|
-
> `node <path-to-project>/dist/src/start.js stdio` — see `CLAUDE.md` for details.
|
|
153
|
-
|
|
154
|
-
## HTTP Mode Endpoints
|
|
155
|
-
|
|
156
|
-
- **/** - Home page
|
|
157
|
-
- **/health** - Health check
|
|
158
|
-
- **/sse** - Server-Sent Events
|
|
159
|
-
- **/mcp** - JSON-RPC 2.0
|
|
160
|
-
|
|
161
|
-
## Claude Code Skills
|
|
162
|
-
|
|
163
|
-
The project ships with custom skills in `.claude/skills/`:
|
|
164
|
-
|
|
165
|
-
| Command
|
|
166
|
-
|
|
167
|
-
| `/gen-jwt`
|
|
168
|
-
| `/upgrade-guide`
|
|
169
|
-
| `/feature-prompt-generator` | Turn a feature description into a self-sufficient prompt for an AI CLI
|
|
170
|
-
| `/readme-generator`
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
`
|
|
183
|
-
|
|
184
|
-
`
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
```
|
|
191
|
-
|
|
1
|
+
# {{project.productName}}
|
|
2
|
+
|
|
3
|
+
{{project.description}}
|
|
4
|
+
|
|
5
|
+
## Install & Run
|
|
6
|
+
|
|
7
|
+
### Quick Start
|
|
8
|
+
```bash
|
|
9
|
+
# Install
|
|
10
|
+
npm install
|
|
11
|
+
|
|
12
|
+
# Configure (copy config/local.yaml from config/_local.yaml)
|
|
13
|
+
# Add database credentials
|
|
14
|
+
|
|
15
|
+
# Build
|
|
16
|
+
npm run build
|
|
17
|
+
|
|
18
|
+
# Run (STDIO mode for Claude Desktop)
|
|
19
|
+
npm start
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Test Run
|
|
23
|
+
```bash
|
|
24
|
+
# Unit tests
|
|
25
|
+
npm test
|
|
26
|
+
|
|
27
|
+
# MCP protocol tests
|
|
28
|
+
npm run test:mcp # STDIO mode
|
|
29
|
+
npm run test:mcp-http # HTTP mode
|
|
30
|
+
npm run test:mcp-simple # Simple test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Dual Transport System
|
|
34
|
+
|
|
35
|
+
**STDIO Mode** (default for Claude Desktop):
|
|
36
|
+
- Direct stdin/stdout communication
|
|
37
|
+
- Optimal for Claude Desktop integration
|
|
38
|
+
- No network ports required
|
|
39
|
+
|
|
40
|
+
**HTTP Mode** (web integration):
|
|
41
|
+
- HTTP server with Server-Sent Events (SSE)
|
|
42
|
+
- Home page with server status at `http://localhost:{{port}}/`
|
|
43
|
+
- Health check endpoint at `/health`
|
|
44
|
+
- Direct JSON-RPC 2.0 endpoint at `/mcp`
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## MCP Tools
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
## MCP Prompts
|
|
56
|
+
|
|
57
|
+
### `agent_brief`
|
|
58
|
+
Brief description of agent capabilities for agent selection.
|
|
59
|
+
|
|
60
|
+
### `agent_prompt`
|
|
61
|
+
Complete prompt with instructions.
|
|
62
|
+
|
|
63
|
+
## MCP Resources
|
|
64
|
+
|
|
65
|
+
### `staff://agent/brief`
|
|
66
|
+
Same as `agent_brief` prompt. **MIME:** text/plain
|
|
67
|
+
|
|
68
|
+
### `staff://agent/prompt`
|
|
69
|
+
Same as `agent_prompt` prompt. **MIME:** text/plain
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
## 2. Configuration
|
|
73
|
+
|
|
74
|
+
**Option A: Configuration File**
|
|
75
|
+
|
|
76
|
+
**Option B: Environment Variables**
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## Usage with AI CLIs
|
|
80
|
+
|
|
81
|
+
The server exposes an HTTP MCP endpoint at `http[s]://<host[:port]>/mcp`. Authentication (when enabled in
|
|
82
|
+
`config/default.yaml` → `webServer.auth`) is passed via the standard `Authorization` header — most commonly a
|
|
83
|
+
JWT Bearer token generated by the `/gen-jwt` skill or by `node scripts/generate-jwt.js`.
|
|
84
|
+
|
|
85
|
+
### With Claude Code
|
|
86
|
+
|
|
87
|
+
Add to `~\.claude.json`:
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"mcpServers": {
|
|
92
|
+
"{{project.name}}": {
|
|
93
|
+
"type": "http",
|
|
94
|
+
"url": "http[s]://<host[:port]>/mcp",
|
|
95
|
+
"headers": {
|
|
96
|
+
"Authorization": "Bearer <jwt-token>"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### With Claude Desktop
|
|
104
|
+
|
|
105
|
+
Add to your Claude Desktop configuration (`claude_desktop_config.json`):
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"{{project.name}}": {
|
|
111
|
+
"command": "npx",
|
|
112
|
+
"args": [
|
|
113
|
+
"-y",
|
|
114
|
+
"mcp-remote@latest",
|
|
115
|
+
"http[s]://<host[:port]>/mcp",
|
|
116
|
+
"--header",
|
|
117
|
+
"Authorization: Bearer <jwt-token>",
|
|
118
|
+
"--allow-http",
|
|
119
|
+
"--transport",
|
|
120
|
+
"http-only"
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### With Qwen Code
|
|
128
|
+
|
|
129
|
+
Add to `~\.qwen\settings.json`:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"{{project.name}}": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": [
|
|
137
|
+
"-y",
|
|
138
|
+
"mcp-remote@latest",
|
|
139
|
+
"http[s]://<host[:port]>/mcp",
|
|
140
|
+
"--header",
|
|
141
|
+
"Authorization: Bearer <jwt-token>",
|
|
142
|
+
"--allow-http",
|
|
143
|
+
"--transport",
|
|
144
|
+
"http-only"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
> For STDIO transport (local Claude Desktop integration without an HTTP server), run
|
|
152
|
+
> `node <path-to-project>/dist/src/start.js stdio` — see `CLAUDE.md` for details.
|
|
153
|
+
|
|
154
|
+
## HTTP Mode Endpoints
|
|
155
|
+
|
|
156
|
+
- **/** - Home page
|
|
157
|
+
- **/health** - Health check
|
|
158
|
+
- **/sse** - Server-Sent Events
|
|
159
|
+
- **/mcp** - JSON-RPC 2.0
|
|
160
|
+
|
|
161
|
+
## Claude Code Skills
|
|
162
|
+
|
|
163
|
+
The project ships with custom skills in `.claude/skills/`:
|
|
164
|
+
|
|
165
|
+
| Command | Description |
|
|
166
|
+
|-----------------------------|------------------------------------------------------------------------------|
|
|
167
|
+
| `/gen-jwt` | Generate JWT tokens for MCP server authentication |
|
|
168
|
+
| `/upgrade-guide` | Generate migration guide for `fa-mcp-sdk` upgrades |
|
|
169
|
+
| `/feature-prompt-generator` | Turn a feature description into a self-sufficient prompt for an AI CLI |
|
|
170
|
+
| `/readme-generator` | Generate structured README.md + satellite `readme-docs/*.md` |
|
|
171
|
+
| `/mcp-app-create` | Scaffold a new MCP App (interactive UI: tool + HTML resource via ext-apps) |
|
|
172
|
+
| `/mcp-app-add-to-server` | Enrich existing MCP server tools with interactive UIs (MCP Apps SDK) |
|
|
173
|
+
|
|
174
|
+
Details, launch modes, and examples: [SKILLS](readme-docs/SKILLS.md)
|
|
175
|
+
|
|
176
|
+
## Security
|
|
177
|
+
|
|
178
|
+
### Admin panel JWT requirement
|
|
179
|
+
|
|
180
|
+
When `adminPanel.authType` includes `jwtToken`, the admin panel (`/admin`) accepts a JWT
|
|
181
|
+
**only if its payload contains `allow: 'gen-token'`**. JWTs without this claim are
|
|
182
|
+
rejected with `401` — this blocks short-lived tokens issued for other purposes (for
|
|
183
|
+
example, the 5-minute JWT auto-generated by the Agent Tester page and written into its
|
|
184
|
+
`Authorization` header) from being replayed to mint arbitrary long-lived tokens.
|
|
185
|
+
|
|
186
|
+
`permanentServerTokens` and `basic` admin auth are unaffected by this check.
|
|
187
|
+
|
|
188
|
+
Generate an admin-capable JWT:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
node scripts/generate-jwt.js -u admin -ttl 30d -p "allow=gen-token"
|
|
192
|
+
```
|
|
193
|
+
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
preset: 'ts-jest',
|
|
3
|
-
testEnvironment: 'node',
|
|
4
|
-
testMatch: ['**/tests/**/*.test.ts', '**/tests/**/*.spec.ts'],
|
|
5
|
-
collectCoverageFrom: [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
detectOpenHandles: true,
|
|
29
|
-
testTimeout: 10000
|
|
30
|
-
};
|
|
1
|
+
export default {
|
|
2
|
+
preset: 'ts-jest',
|
|
3
|
+
testEnvironment: 'node',
|
|
4
|
+
testMatch: ['**/tests/**/*.test.ts', '**/tests/**/*.spec.ts'],
|
|
5
|
+
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts', '!src/index.ts'],
|
|
6
|
+
coverageDirectory: 'coverage',
|
|
7
|
+
coverageReporters: ['text', 'lcov'],
|
|
8
|
+
verbose: false,
|
|
9
|
+
silent: true,
|
|
10
|
+
reporters: ['<rootDir>/tests/jest-simple-reporter.js'],
|
|
11
|
+
moduleNameMapper: {
|
|
12
|
+
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
13
|
+
},
|
|
14
|
+
transform: {
|
|
15
|
+
'^.+\\.ts$': [
|
|
16
|
+
'ts-jest',
|
|
17
|
+
{
|
|
18
|
+
useESM: true,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
transformIgnorePatterns: ['node_modules/(?!(chalk|@modelcontextprotocol|af-.*)/)'],
|
|
23
|
+
extensionsToTreatAsEsm: ['.ts'],
|
|
24
|
+
forceExit: true,
|
|
25
|
+
detectOpenHandles: true,
|
|
26
|
+
testTimeout: 10000,
|
|
27
|
+
};
|
|
@@ -16,9 +16,13 @@
|
|
|
16
16
|
"ci": "node --no-deprecation ./scripts/npm/run.js",
|
|
17
17
|
"reinstall": "node --no-deprecation ./scripts/npm/run.js reinstall",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
19
|
-
"lint": "
|
|
20
|
-
"lint:fix": "
|
|
21
|
-
"
|
|
19
|
+
"lint": "oxlint .",
|
|
20
|
+
"lint:fix": "oxlint --fix .",
|
|
21
|
+
"format": "oxfmt --check .",
|
|
22
|
+
"format:fix": "oxfmt .",
|
|
23
|
+
"quality": "npm run lint && npm run format",
|
|
24
|
+
"quality:fix": "npm run lint:fix && npm run format:fix",
|
|
25
|
+
"lint-fix-build": "oxlint --fix . && oxfmt . && rimraf dist && tsc",
|
|
22
26
|
"generate-token": "node node_modules/fa-mcp-sdk/dist/core/auth/token-generator/server.js",
|
|
23
27
|
"dead:exports": "ts-prune",
|
|
24
28
|
"dead:files": "knip",
|
|
@@ -50,15 +54,16 @@
|
|
|
50
54
|
"dependencies": {
|
|
51
55
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
52
56
|
"dotenv": "^17.4.1",
|
|
53
|
-
"fa-mcp-sdk": "^0.4.
|
|
57
|
+
"fa-mcp-sdk": "^0.4.77"
|
|
54
58
|
},
|
|
55
59
|
"devDependencies": {
|
|
56
60
|
"@types/express": "^5.0.6",
|
|
57
61
|
"@types/jest": "^30.0.0",
|
|
58
62
|
"@types/node": "^25.5.2",
|
|
59
63
|
"cross-env": "^10.1.0",
|
|
60
|
-
"eslint-config-at-26-2": "^26.4.9",
|
|
61
64
|
"jest": "^30.3.0",
|
|
65
|
+
"oxfmt": "^0.48.0",
|
|
66
|
+
"oxlint": "^1.63.0",
|
|
62
67
|
"rimraf": "^6.1.3",
|
|
63
68
|
"ts-jest": "^29.4.9",
|
|
64
69
|
"tsx": "^4.21.0",
|