TypeScript · MCP · Explicit contracts

Decorator-first MCP.
Built for boundaries.

Published @theorvane/type-mcp@0.2.2 turns strict TypeScript declarations into a validated runtime, while applications retain ownership of hosting and policy.

import { z } from "zod";
import { McpServer, McpTool } from "@theorvane/type-mcp";

@McpServer({ name: "catalog", version: "0.2.0" })
class CatalogTools {
  @McpTool({ input: z.object({ id: z.string() }) })
  findProduct({ id }: { id: string }) { return { id, available: true }; }
}

Contract inspection

Declare once.
Ship a contract.

Definitions stay inspectable before the runtime boundary your application owns.

01

Declare

Place MCP intent and structured schemas beside the TypeScript methods they describe.

02

Validate

Check definitions before runtime compilation so contracts are inspectable.

03

Compile

Build the official MCP SDK surface through explicit instance resolution.

04

Host

Connect stdio or Streamable HTTP at the application edge, where hosting and authorization remain yours.

Architecture

Declarations in.
MCP surfaces out.

  1. 01DeclarePlace MCP intent and structured schemas beside the TypeScript methods they describe.
  2. 02ValidateCheck definitions before runtime compilation so contracts are inspectable.
  3. 03CompileBuild the official MCP SDK surface through explicit instance resolution.
  4. 04HostConnect stdio or Streamable HTTP at the application edge, where hosting and authorization remain yours.

Integration boundary

Tools in. Graphs stay yours.

@theorvane/type-mcp/langchain is a tools-only adapter that converts decorated MCP tools to LangChain tools backed by structured schemas.

Use those tools with a consumer-owned LangGraph ToolNode. Your application owns graph topology, model choice, authorization, state, persistence, and deployment.

Get started

Read the contract.
Start with a tool.