Documentation
¶
Overview ¶
Package velocitymcp is a first-party SDK for building MCP (Model Context Protocol) servers on the Velocity web framework.
The root package contains no code; functionality lives in domain packages:
- jsonrpc: JSON-RPC 2.0 message types (leaf)
- schema: fluent JSON Schema builder for tool arguments (leaf)
- content: MCP content types: text, image, audio, blob, resource link (leaf)
- server: Server, primitives (Tool, Resource, Prompt), registrar
- server/methods: protocol method handlers (initialize, tools/call, ...)
- transport: stdio and Velocity-router HTTP transports
- module: chain module (typed registration + /mcp route)
- event: MCP events dispatched through Velocity's event system
- mcptest: test helpers and fakes
Directories
¶
| Path | Synopsis |
|---|---|
|
Package client is an MCP client for talking to MCP servers over stdio or streamable HTTP.
|
Package client is an MCP client for talking to MCP servers over stdio or streamable HTTP. |
|
oauth
Package oauth implements the client-side OAuth 2.0 authorization flows an MCP client uses to obtain a bearer token for a protected MCP server, following the MCP authorization specification: protected-resource and authorization-server metadata discovery (RFC 9728 / RFC 8414), PKCE (RFC 7636), client ID metadata documents, dynamic client registration (RFC 7591), and the authorization-code, refresh-token, and client-credentials grants.
|
Package oauth implements the client-side OAuth 2.0 authorization flows an MCP client uses to obtain a bearer token for a protected MCP server, following the MCP authorization specification: protected-resource and authorization-server metadata discovery (RFC 9728 / RFC 8414), PKCE (RFC 7636), client ID metadata documents, dynamic client registration (RFC 7591), and the authorization-code, refresh-token, and client-credentials grants. |
|
Package console provides the MCP code-generator commands (make:mcp-tool, make:mcp-resource, make:mcp-prompt) that scaffold primitive starter files into a user's project.
|
Package console provides the MCP code-generator commands (make:mcp-tool, make:mcp-resource, make:mcp-prompt) that scaffold primitive starter files into a user's project. |
|
Package content defines the MCP content types returned by tools, resources, and prompts: Text, Image, Audio, Blob, ResourceLink, and Notification.
|
Package content defines the MCP content types returned by tools, resources, and prompts: Text, Image, Audio, Blob, ResourceLink, and Notification. |
|
Package event defines MCP lifecycle events (e.g.
|
Package event defines MCP lifecycle events (e.g. |
|
Package jsonrpc defines the JSON-RPC 2.0 message types (request, response, notification, error) used by the MCP protocol.
|
Package jsonrpc defines the JSON-RPC 2.0 message types (request, response, notification, error) used by the MCP protocol. |
|
Package mcpclient is the application-facing integration layer for consuming MCP servers from a Velocity web app.
|
Package mcpclient is the application-facing integration layer for consuming MCP servers from a Velocity web app. |
|
Package mcptest provides test helpers for MCP servers: fake transports and fluent response assertions.
|
Package mcptest provides test helpers for MCP servers: fake transports and fluent response assertions. |
|
Package module wires an MCP server into a Velocity application as a first-party chain module: typed registration in the component registry plus automatic mounting of the streamable-HTTP transport.
|
Package module wires an MCP server into a Velocity application as a first-party chain module: typed registration in the component registry plus automatic mounting of the streamable-HTTP transport. |
|
Package schema provides a fluent JSON Schema builder for describing MCP tool arguments, plus protocol metadata types (Implementation, Icon).
|
Package schema provides a fluent JSON Schema builder for describing MCP tool arguments, plus protocol metadata types (Implementation, Icon). |
|
Package server provides the MCP server core: the Server type, the primitives (Tool, Resource, Prompt), per-session context, and the registrar for exposing servers over transports (Web, Local).
|
Package server provides the MCP server core: the Server type, the primitives (Tool, Resource, Prompt), per-session context, and the registrar for exposing servers over transports (Web, Local). |
|
methods
Package methods implements the MCP protocol method handlers: initialize, ping, tools/list, tools/call, resources/list, resources/read, resources/templates/list, prompts/list, prompts/get, completion/complete.
|
Package methods implements the MCP protocol method handlers: initialize, ping, tools/list, tools/call, resources/list, resources/read, resources/templates/list, prompts/list, prompts/get, completion/complete. |
|
oauth
Package oauth is the resource-server side of OAuth for an MCP server mounted on the velocity router: the bearer challenge that tells a client where to authorize, the discovery documents that describe this resource and its authorization server, and an optional dynamic client registration endpoint.
|
Package oauth is the resource-server side of OAuth for an MCP server mounted on the velocity router: the bearer challenge that tells a client where to authorize, the discovery documents that describe this resource and its authorization server, and an optional dynamic client registration endpoint. |
|
Package transport defines the Transport contract and its implementations: Stdio (local processes), HTTP (mounted on the Velocity router), and Fake (testing).
|
Package transport defines the Transport contract and its implementations: Stdio (local processes), HTTP (mounted on the Velocity router), and Fake (testing). |
|
Package ui carries the metadata for MCP UI app resources: the optional extension where a resource serves an interactive HTML application (mimeType "text/html;profile=mcp-app") that an MCP host renders in a sandboxed frame.
|
Package ui carries the metadata for MCP UI app resources: the optional extension where a resource serves an interactive HTML application (mimeType "text/html;profile=mcp-app") that an MCP host renders in a sandboxed frame. |
Click to show internal directories.
Click to hide internal directories.