Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
[![License](https://img.shields.io/badge/license-MIT-111827?style=flat-square)](LICENSE)
</div>

> **Published package — `@theorvane/type-mcp@0.3.2`:** provides standard decorators, a separate `@theorvane/type-mcp/legacy` entrypoint for CommonJS legacy decorators, definition validation, explicit instance resolution, MCP SDK compilation, stdio, `@theorvane/type-mcp/http` Streamable HTTP, and the tools-only `@theorvane/type-mcp/langchain` adapter.
>
> **Current `dev` source:** additionally includes SDK v2 protocol negotiation, modern component metadata, tool output schemas, explicit prompt arguments, resource URI templates, completion, invocation context, protocol-backed testing, image/audio helpers, and component visibility. The examples and capability map below target current source unless they explicitly say “published package.”
> **Release `@theorvane/type-mcp@0.4.0`:** adds MCP SDK v2 protocol serving, modern component metadata and instructions, structured outputs, prompt arguments, resource templates and completion, invocation context, protocol-backed testing, media helpers, and component visibility while retaining the standard, legacy, HTTP, LangChain, and stdio boundaries.
>
> **Integration boundary:** LangGraph `ToolNode` composition, graph topology, model choice, authorization, state, persistence, and deployment remain consumer responsibilities.

Expand All @@ -37,7 +35,7 @@ TypeMCP requires **Node.js 20 or later** and TypeScript with standard (Stage 3)
npm install @theorvane/type-mcp zod
```

The install command currently resolves to published `0.3.2`. Modern server/component metadata, initialization instructions, and tool `outputSchema` shown below are implemented on `dev` but are not part of that published version yet.
Version `0.4.0` includes the modern server/component metadata, initialization instructions, tool `outputSchema`, and additional capabilities documented below.

The package has ESM and CommonJS runtime and TypeScript declaration conditions for its root, HTTP, LangChain, and legacy entrypoints. The verified decorator modes are standard decorators in an ESM/NodeNext consumer and legacy `experimentalDecorators` in a CommonJS/Node16 consumer. This standard-decorator `tsconfig.json` baseline matches the package contract:

Expand Down Expand Up @@ -120,11 +118,11 @@ console.log(definition?.tools[0]?.name); // "findProduct"

`getMcpServerDefinition()` returns `undefined` for a class without `@McpServer`. For a decorated class, it returns a newly allocated frozen metadata container on every call. Zod schemas retain their original identity, so treat a schema passed to a decorator as immutable after declaration.

The methods above are ordinary application methods. In current source, use `createMcpServer()` to validate and compile this declaration through an explicit resolver; choose an adapter exported by the installed package only when the application owns its hosting, authorization, and lifecycle policy. Follow the [getting-started guide](docs/guides/getting-started.md) for the complete version boundary.
The methods above are ordinary application methods. In `0.4.0`, use `createMcpServer()` to validate and compile this declaration through an explicit resolver; choose an adapter exported by the installed package only when the application owns its hosting, authorization, and lifecycle policy. Follow the [getting-started guide](docs/guides/getting-started.md) for the complete version boundary.

## Capability map

| Surface | Current source | What it does |
| Surface | `@theorvane/type-mcp@0.4.0` | What it does |
| --- | --- | --- |
| `@McpServer` | Available | Records standard implementation identity and optional client initialization instructions. |
| `@McpTool` | Available | Records input/output Zod schemas and metadata; object returns emit text plus structured content. |
Expand All @@ -147,7 +145,7 @@ The methods above are ordinary application methods. In current source, use `crea

- [Getting started](docs/guides/getting-started.md) — install, declare, inspect, and compile a TypeMCP server.
- [Choose a runtime boundary](docs/guides/runtime-selection.md) — select the released root, stdio, HTTP, or tools-only LangChain surface.
- [Dynamic prompts and resources](docs/guides/dynamic-declarations.md) — explicit prompt arguments, URI templates, and completion in current source.
- [Dynamic prompts and resources](docs/guides/dynamic-declarations.md) — explicit prompt arguments, URI templates, and completion in 0.4.0.
- [Invocation context](docs/guides/invocation-context.md) — request identity, cancellation, progress, and streaming constraints.
- [Testing and media helpers](docs/guides/testing-media.md) — in-memory protocol sessions and image/audio byte results.
- [Component visibility](docs/guides/component-visibility.md) — static state, runtime filters, allowlists, and security boundaries.
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TypeMCP documentation

TypeMCP is a decorator-first TypeScript package for describing an MCP server and compiling that description at an explicit application boundary. The published package is [`@theorvane/type-mcp@0.3.0`](https://www.npmjs.com/package/@theorvane/type-mcp).
TypeMCP is a decorator-first TypeScript package for describing an MCP server and compiling that description at an explicit application boundary. The published package is [`@theorvane/type-mcp@0.4.0`](https://www.npmjs.com/package/@theorvane/type-mcp).

> **Published boundary:** TypeMCP provides declaration metadata, definition validation, MCP SDK compilation, an explicit resolver seam, a stdio helper, a Fetch Streamable HTTP adapter, and a tools-only LangChain adapter. Applications retain ownership of **hosting, authorization, persistence, models, LangGraph composition, and deployment**.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/decorator-api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Decorator API contract

**Published baseline:** [`@theorvane/type-mcp@0.3.2`](https://www.npmjs.com/package/@theorvane/type-mcp) provides decorator declarations, definition validation, MCP SDK compilation for tools/static resources/prompts, a Node stdio helper, and a Fetch Streamable HTTP adapter. The contract below describes current `dev` source, including SDK v2 serving, server identity/instructions, modern component metadata, tool `outputSchema`, explicit prompt arguments, resource URI templates, completion, and invocation context. LangChain interoperability is isolated at `@theorvane/type-mcp/langchain`.
**Release contract:** [`@theorvane/type-mcp@0.4.0`](https://www.npmjs.com/package/@theorvane/type-mcp) provides SDK v2 serving, modern server/component metadata, structured tool output, prompt arguments, resource templates and completion, invocation context, testing/media helpers, component visibility, stdio, Fetch Streamable HTTP, and tools-only LangChain interoperability.

## Server declaration

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Architecture overview

> **Public release:** [`@theorvane/type-mcp@0.3.0`](https://www.npmjs.com/package/@theorvane/type-mcp) implements the metadata, validation, resolver, compiler, stdio, HTTP, and LangChain adapter surfaces described here. Applications remain responsible for hosting and lifecycle policy.
> **Public release:** [`@theorvane/type-mcp@0.4.0`](https://www.npmjs.com/package/@theorvane/type-mcp) implements the metadata, validation, resolver, compiler, stdio, HTTP, and LangChain adapter surfaces described here. Applications remain responsible for hosting and lifecycle policy.

## Package surface

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/agent-integration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Agent integration guide

This guide gives coding agents a deterministic procedure for adding TypeMCP declarations without inventing application-owned policy. It applies to the published `@theorvane/type-mcp@0.3.0` package.
This guide gives coding agents a deterministic procedure for adding TypeMCP declarations without inventing application-owned policy. It applies to the published `@theorvane/type-mcp@0.4.0` package.

## Capability contract agents must honor

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/component-visibility.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Component visibility

**Availability:** current `dev` source; not included in published `0.3.2`.
**Availability:** included in `@theorvane/type-mcp@0.4.0`.

Tools, resources/templates, and prompts accept `enabled` and `tags`. Components are enabled by default.

Expand Down
12 changes: 6 additions & 6 deletions docs/guides/configuration.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Configuration and compatibility

`@theorvane/type-mcp@0.3.2` is the published TypeScript declaration and runtime package, verified against the npm registry after its reviewed `main` promotion. Configuration determines whether TypeScript emits standard decorators and whether the runtime can resolve the package's ESM/CJS exports; applications configure their own hosting and transport lifecycle around installed MCP adapters.
`@theorvane/type-mcp@0.4.0` is the published TypeScript declaration and runtime package, verified against the npm registry after its reviewed `main` promotion. Configuration determines whether TypeScript emits standard decorators and whether the runtime can resolve the package's ESM/CJS exports; applications configure their own hosting and transport lifecycle around installed MCP adapters.

## Runtime and package manager

Use Node.js 20 or later. After `npm view @theorvane/type-mcp@0.3.0 version` succeeds, install TypeMCP and Zod as application dependencies:
Use Node.js 20 or later. After `npm view @theorvane/type-mcp@0.4.0 version` succeeds, install TypeMCP and Zod as application dependencies:

```bash
npm install @theorvane/type-mcp@0.3.0 zod
npm install @theorvane/type-mcp@0.4.0 zod
```

The package name and import are scoped to Theorvane:
Expand All @@ -16,7 +16,7 @@ The package name and import are scoped to Theorvane:
import { McpServer, McpTool } from "@theorvane/type-mcp";
```

The public `@theorvane/type-mcp@0.3.0` package exports `@theorvane/type-mcp/http`. Add it where the application owns Fetch route hosting, durable session policy, and authorization; the adapter owns in-process MCP session routing around the SDK transport.
The public `@theorvane/type-mcp@0.4.0` package exports `@theorvane/type-mcp/http`. Add it where the application owns Fetch route hosting, durable session policy, and authorization; the adapter owns in-process MCP session routing around the SDK transport.

## TypeScript decorators

Expand Down Expand Up @@ -69,10 +69,10 @@ find({ id }: z.infer<typeof findInput>) {
}
```

A missing component `name` defaults to the method name. `0.3.0` validates the decorated definition before compilation; application tests should still protect domain naming conventions.
A missing component `name` defaults to the method name. `0.4.0` validates the decorated definition before compilation; application tests should still protect domain naming conventions.

## Registry release versus repository development

The published `@theorvane/type-mcp@0.3.0` root exports `McpServer`, `McpTool`, `McpResource`, `McpPrompt`, `getMcpServerDefinition`, `readMcpServerDefinition`, `TypeMcpDefinitionError`, `InstanceResolver`, `resolveMcpServerInstance`, `createMcpServer`, and `startStdioServer`. The `@theorvane/type-mcp/http` and `@theorvane/type-mcp/langchain` subpaths expose their respective adapters.
The published `@theorvane/type-mcp@0.4.0` root exports `McpServer`, `McpTool`, `McpResource`, `McpPrompt`, `getMcpServerDefinition`, `readMcpServerDefinition`, `TypeMcpDefinitionError`, `InstanceResolver`, `resolveMcpServerInstance`, `createMcpServer`, and `startStdioServer`. The `@theorvane/type-mcp/http` and `@theorvane/type-mcp/langchain` subpaths expose their respective adapters.

Before upgrading, read the release notes and inspect the package's generated type declarations. Treat a feature as available only when a released version documents it and the installed package exports it.
2 changes: 1 addition & 1 deletion docs/guides/core-concepts.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Core concepts

This page explains the published [`@theorvane/type-mcp@0.3.0`](https://www.npmjs.com/package/@theorvane/type-mcp) model before you choose a runtime boundary.
This page explains the published [`@theorvane/type-mcp@0.4.0`](https://www.npmjs.com/package/@theorvane/type-mcp) model before you choose a runtime boundary.

> **Responsibility boundary:** TypeMCP provides declaration metadata, validation, MCP SDK compilation, and selected adapters. Applications retain ownership of **hosting, authorization, persistence, models, LangGraph composition, and deployment**.

Expand Down
2 changes: 1 addition & 1 deletion docs/guides/dynamic-declarations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dynamic prompts and resources

Current `dev` source adds explicit prompt arguments and resource URI templates. These APIs are unreleased until the next reviewed package promotion.
TypeMCP 0.4.0 adds explicit prompt arguments, resource URI templates, and completion.

## Prompt arguments and completion

Expand Down
10 changes: 5 additions & 5 deletions docs/guides/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Getting started with `@theorvane/type-mcp@0.3.0`
# Getting started with `@theorvane/type-mcp@0.4.0`

This guide creates and inspects an MCP **declaration** using the published `@theorvane/type-mcp@0.3.0` package. It also validates and compiles decorated definitions through `createMcpServer()`; the [HTTP guide](http-and-nextjs.md) and [LangChain guide](langchain-langgraph.md) cover their focused adapter boundaries.
This guide creates and inspects an MCP **declaration** using the published `@theorvane/type-mcp@0.4.0` package. It also validates and compiles decorated definitions through `createMcpServer()`; the [HTTP guide](http-and-nextjs.md) and [LangChain guide](langchain-langgraph.md) cover their focused adapter boundaries.

## Install the package and configure TypeScript

Install the package and import Zod directly in the application that owns its schemas:

```bash
npm install @theorvane/type-mcp@0.3.0 zod
npm install @theorvane/type-mcp@0.4.0 zod
```

Run on Node.js 20 or later. Use standard TypeScript decorators with Node-aware ESM settings. A minimal `tsconfig.json` is:
Expand Down Expand Up @@ -71,7 +71,7 @@ export class NotesServer {
}
```

The public component name defaults to the method name when `name` is omitted. TypeMCP records these options as metadata and `0.3.0` validates the decorated definition before compilation; use application tests for domain-specific naming conventions.
The public component name defaults to the method name when `name` is omitted. TypeMCP records these options as metadata and `0.4.0` validates the decorated definition before compilation; use application tests for domain-specific naming conventions.

## Inspect metadata at an application boundary

Expand Down Expand Up @@ -100,6 +100,6 @@ The function returns `undefined` for a class without `@McpServer`. For a decorat

## Continue through the runtime boundary

The published `@theorvane/type-mcp@0.3.0` package contains `createMcpServer()`, `startStdioServer()`, `@theorvane/type-mcp/http`, and `@theorvane/type-mcp/langchain`. TypeMCP validates and compiles decorated definitions through an explicit `InstanceResolver`; it does not choose a web host, authorization model, session store, LangGraph topology, model, or persistence policy for the application.
The published `@theorvane/type-mcp@0.4.0` package contains `createMcpServer()`, `startStdioServer()`, `@theorvane/type-mcp/http`, and `@theorvane/type-mcp/langchain`. TypeMCP validates and compiles decorated definitions through an explicit `InstanceResolver`; it does not choose a web host, authorization model, session store, LangGraph topology, model, or persistence policy for the application.

The declaration created above remains useful for application-owned inspection. Read [core concepts](core-concepts.md) for the definition/compiler model, then follow the [Petstore walkthrough](petstore-walkthrough.md) to select stdio, HTTP, or LangChain reuse. Consult the [configuration guide](configuration.md), [HTTP guide](http-and-nextjs.md), [LangChain guide](langchain-langgraph.md), and [agent guide](agent-integration.md) before automating a change.
2 changes: 1 addition & 1 deletion docs/guides/http-and-nextjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ This is a route integration shape, not a full Next.js scaffold. It intentionally

## Published package boundary

The published `@theorvane/type-mcp@0.3.0` package includes `createMcpServer()` and `@theorvane/type-mcp/http`. This guide demonstrates the package API, while hosting, authentication, persistence, and authorization remain application-owned responsibilities.
The published `@theorvane/type-mcp@0.4.0` package includes `createMcpServer()` and `@theorvane/type-mcp/http`. This guide demonstrates the package API, while hosting, authentication, persistence, and authorization remain application-owned responsibilities.
2 changes: 1 addition & 1 deletion docs/guides/invocation-context.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Invocation context, cancellation, and progress

**Availability:** current `dev` source; not included in published `0.3.2`.
**Availability:** included in `@theorvane/type-mcp@0.4.0`.

Every decorated tool, resource, and prompt handler may opt into a final `McpInvocationContext` argument. Existing handlers remain valid because JavaScript ignores arguments they do not declare.

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/langchain-langgraph.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# LangChain and LangGraph integration

> **Published boundary:** `@theorvane/type-mcp/langchain` is part of the published `@theorvane/type-mcp@0.3.0` package. It is tools-only; LangGraph remains a consumer-owned composition choice.
> **Published boundary:** `@theorvane/type-mcp/langchain` is part of the published `@theorvane/type-mcp@0.4.0` package. It is tools-only; LangGraph remains a consumer-owned composition choice.

## Scope

Expand All @@ -16,7 +16,7 @@ The core package and `@theorvane/type-mcp/http` remain independent of agent fram
The adapter has an optional peer dependency on `@langchain/core`. A consumer that imports the adapter must install a compatible peer:

```bash
npm install @theorvane/type-mcp@0.3.0 @langchain/core zod
npm install @theorvane/type-mcp@0.4.0 @langchain/core zod
```

LangGraph is a consumer choice, not an adapter dependency. Install it only when using a graph:
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/mcp-sdk-v2-migration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MCP TypeScript SDK v2 migration

The current `dev` source uses the split stable MCP TypeScript SDK v2 packages. Runtime code depends on `@modelcontextprotocol/server@2.0.0`; protocol integration tests use `@modelcontextprotocol/client@2.0.0`. The monolithic `@modelcontextprotocol/sdk` v1 package is no longer installed.
TypeMCP 0.4.0 uses the split stable MCP TypeScript SDK v2 packages. Runtime code depends on `@modelcontextprotocol/server@2.0.0`; protocol integration tests use `@modelcontextprotocol/client@2.0.0`. The monolithic `@modelcontextprotocol/sdk` v1 package is no longer installed.

## HTTP applications

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/petstore-project-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This is the first chapter of the TypeMCP Petstore curriculum. It creates a small local project that can compile a decorated server before the application selects a runtime boundary.

> **Published version:** The examples target [`@theorvane/type-mcp@0.3.0`](https://www.npmjs.com/package/@theorvane/type-mcp). They use standard TypeScript decorators, not legacy `experimentalDecorators`.
> **Published version:** The examples target [`@theorvane/type-mcp@0.4.0`](https://www.npmjs.com/package/@theorvane/type-mcp). They use standard TypeScript decorators, not legacy `experimentalDecorators`.

## Before you start

Expand Down Expand Up @@ -33,7 +33,7 @@ mkdir petstore-workspace
cd petstore-workspace
npm init -y
npm pkg set type=module
npm install @theorvane/type-mcp@0.3.0 zod
npm install @theorvane/type-mcp@0.4.0 zod
npm install --save-dev typescript tsx @types/node
npm pkg set scripts.check="tsc --noEmit"
```
Expand Down
Loading
Loading