@pikku/skills 0.12.29 → 0.12.30
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/CHANGELOG.md +33 -0
- package/dist/skills.gen.js +1 -1
- package/package.json +1 -1
- package/skills/pikku-services/SKILL.md +10 -0
- package/skills/pikku-wiring/references/mcp.md +16 -40
package/package.json
CHANGED
|
@@ -30,6 +30,16 @@ request-scoped logger or audit buffer is a wire service, and startup work that
|
|
|
30
30
|
needs the singletons goes in `pikkuServerLifecycle` rather than in a module's
|
|
31
31
|
top level.
|
|
32
32
|
|
|
33
|
+
## Services the runtime injects
|
|
34
|
+
|
|
35
|
+
`pikku dev` and `pikku serve` build a set of singletons before your
|
|
36
|
+
`createSingletonServices` runs and hand them in as `existingServices` — among
|
|
37
|
+
them `content`, a `LocalContent` storing files under `.pikku-runtime/content`
|
|
38
|
+
and serving them from `/upload` and `/assets`. **You never construct these in
|
|
39
|
+
`services.ts`, and their absence from that file is not evidence they are off.**
|
|
40
|
+
The optional `content` block in `pikku.config.json` only overrides that
|
|
41
|
+
service's paths and size limit; omitting it does not disable it.
|
|
42
|
+
|
|
33
43
|
## Pick the reference
|
|
34
44
|
|
|
35
45
|
| You are… | Read |
|
|
@@ -166,49 +166,25 @@ export const deleteTodo = pikkuFunc({
|
|
|
166
166
|
})
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
##
|
|
169
|
+
## Reaching the server
|
|
170
170
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
You do not start an MCP server. `pikku dev`, `pikku serve` and a deployed app all
|
|
172
|
+
mount one for you: codegen writes `.pikku/mcp/mcp.gen.json`, the runtime loads it,
|
|
173
|
+
and the server is served at **`/mcp`** — so a tool you export is reachable at
|
|
174
|
+
`https://<your-app-url>/mcp` with nothing else to wire. Set `mcpPath` to move it.
|
|
174
175
|
|
|
175
|
-
|
|
176
|
-
// start.ts
|
|
177
|
-
import { PikkuMCPServer } from '@pikku/modelcontextprotocol'
|
|
178
|
-
import { createConfig, createSingletonServices } from './services.js'
|
|
179
|
-
import mcpJSON from '../.pikku/mcp/mcp.gen.json' with { type: 'json' }
|
|
180
|
-
import '../.pikku/pikku-bootstrap.gen.js'
|
|
181
|
-
|
|
182
|
-
const config = await createConfig()
|
|
183
|
-
const singletonServices = await createSingletonServices(config)
|
|
184
|
-
|
|
185
|
-
const server = new PikkuMCPServer(
|
|
186
|
-
{
|
|
187
|
-
name: 'pikku-mcp-server',
|
|
188
|
-
version: '1.0.0',
|
|
189
|
-
mcpJSON,
|
|
190
|
-
capabilities: { logging: {}, tools: {}, resources: {}, prompts: {} },
|
|
191
|
-
},
|
|
192
|
-
singletonServices.logger
|
|
193
|
-
)
|
|
194
|
-
|
|
195
|
-
await server.init()
|
|
196
|
-
|
|
197
|
-
// stdio — the transport desktop MCP clients spawn
|
|
198
|
-
await server.connectStdio()
|
|
199
|
-
singletonServices.logger = server.createMCPLogger()
|
|
200
|
-
|
|
201
|
-
// …or streamable HTTP, for a hosted server
|
|
202
|
-
const { close } = await server.connectHTTP({ port: 3000, host: '127.0.0.1' })
|
|
203
|
-
```
|
|
176
|
+
Two consequences worth stating outright, because both read as breakage:
|
|
204
177
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
178
|
+
- The mount is **conditional on there being something to serve**. An `mcp.gen.json`
|
|
179
|
+
with no tools, resources or prompts is not mounted at all, so `/mcp` 404s until
|
|
180
|
+
the first `mcp: true` function or `pikkuMCP*Func` exists.
|
|
181
|
+
- There is no `wires/mcp` directory and no `mcp` block in `pikku.config.json`.
|
|
182
|
+
A tool *is* its own registration, so the absence of both is what correct MCP
|
|
183
|
+
wiring looks like — not evidence that something was missed.
|
|
208
184
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
185
|
+
When you add a tool, tell whoever asked for it the URL. An assistant that cannot
|
|
186
|
+
be pointed at an endpoint has not been connected to anything, and `/mcp` is the
|
|
187
|
+
whole answer.
|
|
212
188
|
|
|
213
189
|
## Red flags
|
|
214
190
|
|
|
@@ -218,4 +194,4 @@ anything logs.
|
|
|
218
194
|
| `uri`/`title` rejected on `pikkuMCPResourceFunc` | Those belong on `wireMCPResource` |
|
|
219
195
|
| Resource returning `{ uri, blob, mimeType }` | Resources are text only: `{ uri, text }` |
|
|
220
196
|
| Client sees a tool with no description | `mcp: true` without a `description` — check the codegen warning |
|
|
221
|
-
|
|
|
197
|
+
| `/mcp` 404s | Nothing to serve yet — the mount is skipped until one tool, resource or prompt exists |
|