@mcpfn/core 0.0.1 → 0.0.3

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # McpFn Core
2
2
 
3
+ `defineMcpFnServer()` creates a side-effect-free declaration whose registry and
4
+ manifest are shared by runtime, tests, and release tooling. Call
5
+ `declaration.createServer()` once per transport connection. Existing
6
+ `createMcpFnServer()` usage remains supported.
7
+
8
+ Declare protocol capabilities on `defineMcpFnServer()`. Per-connection runtime
9
+ options provide context, visibility, task storage, and transport behavior but
10
+ cannot add capabilities, so `declaration.manifest()` and every runtime manifest
11
+ remain byte-for-byte identical. When combining a supplied registry with inline
12
+ definitions, the declaration clones the registry before adding them.
13
+
3
14
  `@mcpfn/core` is the shared MCP runtime for Superfunctions. It delegates wire protocol and transport behavior to the official Model Context Protocol SDK while providing the pieces product code needs to remain stable:
4
15
 
5
16
  - an explicit, validated tool, resource, template, and prompt registry;
@@ -93,6 +104,6 @@ Use `registerResource`, `registerResourceTemplate`, and `registerPrompt` on the
93
104
 
94
105
  Task support is declared with `execution.taskSupport` and a `taskHandler`; a task-capable server must receive an official SDK `TaskStore`. `server.listRoots()`, `server.sample()`, and `server.elicit()` invoke matching client capabilities. Declare required client features in `clientRequirements` so manifests and host-profile tests can reject incompatible hosts before deployment.
95
106
 
96
- `createWebStandardHandler()` accepts the official SDK `HandleRequestOptions`, including validated `authInfo`. Use `@mcpfn/auth` to publish OAuth protected-resource metadata and produce that trusted value.
107
+ `createWebStandardHandler()` accepts the official SDK `HandleRequestOptions`, including validated `authInfo`. Use `@mcpfn/auth` to publish OAuth protected-resource metadata and produce that trusted value. In stateless mode, McpFn creates and disposes an isolated SDK server and transport for every request. Supply a cryptographically secure `sessionIdGenerator` when the server uses sampling, elicitation, or another server-to-client request that must be correlated across HTTP requests; session-enabled handlers retain their transport across the session.
97
108
 
98
109
  See the [architecture](https://github.com/21nCo/super-functions/blob/main/mcpfn/ARCHITECTURE.md), [testing guide](https://github.com/21nCo/super-functions/blob/main/mcpfn/TESTING.md), and runnable [calculator example](https://github.com/21nCo/super-functions/blob/main/mcpfn/examples/calculator-server.ts).