# Toolgrain - [Introduction](https://toolgrain.mintlify.app/index.md): Bring your TypeScript application to MCP with reusable, typed tools. - [Quickstart](https://toolgrain.mintlify.app/quickstart.md): Build a typed MCP tool and call it with Inspector. - [Installation](https://toolgrain.mintlify.app/getting-started/installation.md): Install published packages and configure a strict ESM TypeScript project. - [Your first tool](https://toolgrain.mintlify.app/getting-started/stdio.md): Split a reusable tool and its stdio server into application modules. - [Your first HTTP server](https://toolgrain.mintlify.app/getting-started/http.md): Serve the same typed tool through a managed Node HTTP listener. - [Connect a client](https://toolgrain.mintlify.app/getting-started/clients.md): Connect Inspector or configure an MCP client for stdio and HTTP. - [Define and compose tools](https://toolgrain.mintlify.app/tools/definitions.md): Define tools once, name them at registration, and create typed variants. - [Inputs, outputs, and inferred types](https://toolgrain.mintlify.app/tools/validation.md): Understand asynchronous input and output parsing with Zod 4. - [Return values and rich content](https://toolgrain.mintlify.app/tools/results.md): Return JSON, rich MCP content, and intentional public errors. - [Errors and private diagnostics](https://toolgrain.mintlify.app/tools/errors.md): Give clients useful feedback and keep unexpected failures in private diagnostics. - [Tool authoring](https://toolgrain.mintlify.app/tools/overview.md): The complete tool authoring contract, from schemas to results and diagnostics. - [Request context](https://toolgrain.mintlify.app/guides/request-context.md): Read request metadata and cancellation from the handler context. - [Lazy context providers](https://toolgrain.mintlify.app/guides/context.md): Resolve typed application services lazily, with request caching and test overrides. - [Cancellation and execution deadlines](https://toolgrain.mintlify.app/guides/cancellation.md): Observe request cancellation and set application operation deadlines. - [Stdio transport](https://toolgrain.mintlify.app/transports/stdio.md): Serve local clients through newline-delimited JSON on stdin and stdout. - [Streamable HTTP](https://toolgrain.mintlify.app/transports/http.md): Choose a listener or handler and configure HTTP request validation. - [Framework recipes](https://toolgrain.mintlify.app/transports/frameworks.md): Mount Toolgrain in Express, Hono, Elysia, and Next.js. - [Custom transports and direct handling](https://toolgrain.mintlify.app/transports/custom.md): Implement a transport or process complete protocol messages directly. - [Transports](https://toolgrain.mintlify.app/transports/overview.md): Detailed stdio and HTTP behavior, lifecycle, and adapter boundaries. - [Protect HTTP endpoints](https://toolgrain.mintlify.app/authentication/overview.md): Protect HTTP endpoints with verified access tokens and request identities. - [JWT access tokens](https://toolgrain.mintlify.app/authentication/jwt.md): Verify OAuth JWT access tokens from your trusted authorization server. - [Clerk OAuth access tokens](https://toolgrain.mintlify.app/authentication/clerk.md): Protect an HTTP server with Clerk OAuth JWT or opaque access tokens. - [HTTP authorization](https://toolgrain.mintlify.app/guides/authorization.md): Detailed HTTP authorization, public resource URLs, routing, and custom providers. - [Test tools and server behavior](https://toolgrain.mintlify.app/guides/testing.md): Test handler logic separately from validation, protocol, and transport behavior. - [Run a server in production](https://toolgrain.mintlify.app/guides/production.md): Plan public URLs, permissions, limits, cancellation, and shutdown. - [Troubleshooting](https://toolgrain.mintlify.app/guides/troubleshooting.md): Diagnose tool, transport, authorization, and client behavior. - [Runnable examples](https://toolgrain.mintlify.app/examples.md): Find complete runnable stdio, HTTP, framework, and authorization examples. - [Compatibility and current limits](https://toolgrain.mintlify.app/compatibility/overview.md): Separate protocol support, runtime commitments, and verified client behavior. - [Client compatibility verification](https://toolgrain.mintlify.app/compatibility/protocol.md): Recorded protocol checks, client setup, and repeatable Inspector commands. - [Client interoperability — 2026-10-22](https://toolgrain.mintlify.app/compatibility/clients.md): Dated client interoperability findings and known timeout and presentation limits. - [Published-package verification — 2026-10-25](https://toolgrain.mintlify.app/compatibility/published-packages.md): Recorded stable and RC archive checks and fresh package consumers. - [@toolgrain/mcp](https://toolgrain.mintlify.app/reference/mcp.md): Public exports and behavior of @toolgrain/mcp. - [Context API](https://toolgrain.mintlify.app/reference/context.md): Request context, direct-call helpers, and lazy provider contracts. - [Shared authorization API](https://toolgrain.mintlify.app/reference/auth.md): Shared authorization providers, scopes, accessors, and errors. - [@toolgrain/node](https://toolgrain.mintlify.app/reference/node.md): Public exports and behavior of @toolgrain/node. - [@toolgrain/http](https://toolgrain.mintlify.app/reference/http.md): Public exports and behavior of @toolgrain/http. - [@toolgrain/jwt](https://toolgrain.mintlify.app/reference/jwt.md): Public exports and behavior of @toolgrain/jwt. - [@toolgrain/clerk](https://toolgrain.mintlify.app/reference/clerk.md): Public exports and behavior of @toolgrain/clerk. - [@toolgrain/protocol](https://toolgrain.mintlify.app/reference/protocol.md): Public exports and behavior of @toolgrain/protocol. - [Contributing](https://toolgrain.mintlify.app/project/contributing.md): Report an issue, prepare a focused change, and verify your pull request. - [Development and verification](https://toolgrain.mintlify.app/project/development.md): Set up the repository and choose the right development and CI checks. - [Architecture and protocol](https://toolgrain.mintlify.app/project/architecture.md): Understand package boundaries, protocol revisions, and transport lifecycle. - [Runtime and dependency support](https://toolgrain.mintlify.app/project/support-policy.md): Supported runtimes, TypeScript, Zod, platforms, and upgrade rules. - [Versioning and releases](https://toolgrain.mintlify.app/project/releases.md): Changesets release planning, automated publication, verification, and recovery. - [Changelogs](https://toolgrain.mintlify.app/project/changelog.md): Find package-specific changes, GitHub releases, and historical release notes. - [Licensing and protocol provenance](https://toolgrain.mintlify.app/project/licensing.md): Locate Toolgrain licenses, upstream protocol terms, and integration notices. ## Optional - [npm packages](https://www.npmjs.com/org/toolgrain) - [Examples](https://github.com/keshavkatwe/toolgrain/tree/main/apps) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.