fa-mcp-sdk 0.4.73 → 0.4.76

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.
@@ -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 | 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
-
172
- Details, launch modes, and examples: [SKILLS](readme-docs/SKILLS.md)
173
-
174
- ## Security
175
-
176
- ### Admin panel JWT requirement
177
-
178
- When `adminPanel.authType` includes `jwtToken`, the admin panel (`/admin`) accepts a JWT
179
- **only if its payload contains `allow: 'gen-token'`**. JWTs without this claim are
180
- rejected with `401` this blocks short-lived tokens issued for other purposes (for
181
- example, the 5-minute JWT auto-generated by the Agent Tester page and written into its
182
- `Authorization` header) from being replayed to mint arbitrary long-lived tokens.
183
-
184
- `permanentServerTokens` and `basic` admin auth are unaffected by this check.
185
-
186
- Generate an admin-capable JWT:
187
-
188
- ```bash
189
- node scripts/generate-jwt.js -u admin -ttl 30d -p "allow=gen-token"
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
+
@@ -50,7 +50,7 @@
50
50
  "dependencies": {
51
51
  "@modelcontextprotocol/sdk": "^1.29.0",
52
52
  "dotenv": "^17.4.1",
53
- "fa-mcp-sdk": "^0.4.73"
53
+ "fa-mcp-sdk": "^0.4.76"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/express": "^5.0.6",
@@ -140,6 +140,91 @@ Characteristics:
140
140
 
141
141
  ---
142
142
 
143
+ ### `/mcp-app-create` — Scaffold a New MCP App
144
+
145
+ Comprehensive guidance for building **MCP Apps** — interactive UIs that render inside MCP-enabled hosts (Claude
146
+ Desktop, etc.) using the [`@modelcontextprotocol/ext-apps`](https://github.com/modelcontextprotocol/ext-apps) SDK.
147
+ Every MCP App pairs an MCP **tool** (called by the LLM/host) with an HTML **resource** (the UI shown to the user);
148
+ the tool's `_meta.ui.resourceUri` links them.
149
+
150
+ What it does:
151
+
152
+ - Clones the upstream `ext-apps` repo into `./mcp-ext-apps/` (added to `.gitignore`) for working examples,
153
+ JSDoc-annotated source, and the formal protocol spec (`specification/2026-01-26/apps.mdx`, SEP-1865)
154
+ - Walks through framework selection — React (with `useApp` hook), Vanilla JS, Vue, Svelte, Preact, Solid —
155
+ using the matching `basic-server-{framework}/` template as a reference
156
+ - Sets up the build pipeline: `vite` + `vite-plugin-singlefile` to bundle UI into a single HTML file, plus
157
+ `tsx` for running the TypeScript server (broader compatibility than `bun`)
158
+ - Generates `registerAppTool` + `registerAppResource` calls with the correct `_meta.ui.resourceUri` linking
159
+ - Implements lifecycle handlers (`ontoolinput`, `ontoolresult`, `onhostcontextchanged`, `onteardown`)
160
+ — emphasising they MUST be registered BEFORE `app.connect()`
161
+ - Covers advanced patterns (`docs/patterns.md`): app-only tools, polling, chunked responses, binary resources,
162
+ CSP/CORS, host context (theme/styles/fonts), fullscreen mode, streaming input, view state, visibility-pause
163
+
164
+ Characteristics:
165
+
166
+ - **Launch**: by command `/mcp-app-create` or by trigger phrases ("create an MCP App", "add a UI to an MCP tool",
167
+ "build an interactive MCP View", "scaffold an MCP App")
168
+ - **Input**: project context (existing server vs new server) + UI requirements
169
+ - **Output**: working tool + resource pair, single-file HTML bundle, framework-specific entry point with
170
+ registered handlers, `vite.config.ts`, updated `package.json` scripts
171
+
172
+ **Examples:**
173
+
174
+ ```
175
+ /mcp-app-create
176
+ /mcp-app-create create an MCP App that shows search results as an interactive table (React)
177
+ /mcp-app-create scaffold a new MCP server with a map UI tool, vanilla JS
178
+ /mcp-app-create build a system-monitor App with a polling chart, use Vue
179
+ ```
180
+
181
+ ---
182
+
183
+ ### `/mcp-app-add-to-server` — Add Interactive UI to Existing MCP Server
184
+
185
+ Analyses the tools already exposed by an existing MCP server and enriches the ones that benefit from UI with
186
+ inline rendering via the MCP Apps SDK. Tools that don't need UI stay untouched; the text fallback is preserved
187
+ for text-only clients, so adding UI is a strict enhancement.
188
+
189
+ What it does:
190
+
191
+ - **Inventories** the server's existing tools (reads source, lists every registered tool)
192
+ - **Classifies** each tool by UI benefit using a decision framework: structured data / metrics over time /
193
+ media → high benefit; simple confirmations → text-only is fine; data feeds for other tools → app-only helper
194
+ - **Confirms** the analysis with the user before writing code
195
+ - Adds `@modelcontextprotocol/ext-apps` + `vite` + `vite-plugin-singlefile` (plus framework deps if needed)
196
+ via `npm install` — never hardcoded versions
197
+ - Configures the build pipeline (`vite.config.ts`, `mcp-app.html` entry, `package.json` scripts: `build:ui`,
198
+ `build:server`, `build`, `serve`) and links resources to tools via `_meta.ui.resourceUri`
199
+ - Converts plain `server.tool(...)` calls to `registerAppTool(...)` with `structuredContent` for the UI
200
+ while keeping the `content` array as a text fallback
201
+ - Registers HTML resources via `registerAppResource(...)` reading the bundled `dist/mcp-app.html`
202
+ - Wires UI lifecycle handlers + applies host styling (`applyDocumentTheme`, `applyHostStyleVariables`,
203
+ `applyHostFonts`, safe-area insets)
204
+ - Optional enhancements: app-only helper tools (`visibility: ["app"]`), CSP/CORS allow-lists
205
+ (`connectDomains` / `resourceDomains` / `frameDomains`), streaming partial input (`ontoolinputpartial`),
206
+ fullscreen mode (`requestDisplayMode`), graceful degradation via `getUiCapability()`
207
+
208
+ Characteristics:
209
+
210
+ - **Launch**: by command `/mcp-app-add-to-server` or by trigger phrases ("add an app to my MCP server",
211
+ "add UI to my MCP server", "add a view to my MCP tool", "enrich MCP tools with UI", "add MCP Apps to
212
+ my server")
213
+ - **Input**: none required — reads the project; user confirms which tools to enhance after the analysis
214
+ - **Output**: refactored `server.ts` (App tools + plain tools coexist), HTML entry + `vite.config.ts`,
215
+ resource registration code, lifecycle handlers in the UI entry, updated `package.json` scripts
216
+
217
+ **Examples:**
218
+
219
+ ```
220
+ /mcp-app-add-to-server
221
+ /mcp-app-add-to-server add UI to the search and analytics tools, leave the lookup tools as text-only
222
+ /mcp-app-add-to-server обогати UI инструмент get_dashboard, остальные оставь без изменений
223
+ /mcp-app-add-to-server add an interactive map view to the geo-search tool
224
+ ```
225
+
226
+ ---
227
+
143
228
  ### `/create-mcp-wizard` — End-to-End MCP Server Implementation
144
229
 
145
230
  Orchestrates the full implementation workflow from feature brief to a live GitLab repo. The project
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "fa-mcp-sdk",
3
3
  "productName": "FA MCP SDK",
4
- "version": "0.4.73",
4
+ "version": "0.4.76",
5
5
  "description": "Core infrastructure and templates for building Model Context Protocol (MCP) servers with TypeScript",
6
6
  "type": "module",
7
7
  "main": "dist/core/index.js",