mcp-to-ai-sdk: Instructions file for Claude Code

CLAUDE.md

mcp-to-ai-sdk CLAUDE.md is an instructions file for Claude Code from vercel-labs/mcp-to-ai-sdk. It costs 745 tokens per session, scanned A, original, Apache-2.0.

A repository guide for mcp-to-ai-sdk, a command-line tool that creates TypeScript wrappers for Model Context Protocol tools. MCP is a standard way for AI applications to connect to external tools and services.

In plain words
What is it for?
Building the command-line tool, connecting it to an MCP server, generating type-safe Vercel AI SDK wrappers, and testing the generated output.
Why use it?
It tells coding agents how this project is organized and how to build and run the command-line tool, reducing guesswork when changing or testing it.

Instructions file for Claude Code ✓ vendor

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is vercel-labs/mcp-to-ai-sdk's own configuration. It tells Claude Code how to work on mcp-to-ai-sdk itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-to-ai-sdk configures →

About the project

mcp-to-ai-sdk is a command-line tool that generates Vercel AI SDK code stubs for tools exposed by Model Context Protocol servers. Developers use the generated stubs to control tool arguments, authentication, and implementations within their applications instead of relying directly on changing MCP definitions. The catalogue instruction supports use of this generation workflow.

vercel-labs/mcp-to-ai-sdk · 123 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to vercel-labs/mcp-to-ai-sdk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vercel-labs/mcp-to-ai-sdk/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/vercel-labs/mcp-to-ai-sdk

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mcp-to-ai-sdk CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/vercel-labs/mcp-to-ai-sdk/claude-md/github.svg)](https://agentmods.dev/instructions/vercel-labs/mcp-to-ai-sdk/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/vercel-labs/mcp-to-ai-sdk/claude-md"><img src="https://agentmods.dev/badge/instructions/vercel-labs/mcp-to-ai-sdk/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mcp-to-ai-sdk CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/vercel-labs/mcp-to-ai-sdk/claude-md"><img src="https://agentmods.dev/badge/instructions/vercel-labs/mcp-to-ai-sdk/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 745 This file is loaded in full into every session.
When invoked 745 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00745 $0.00745
Opus 5.5 $0.00298 $0.00298
Sonnet 5.5 $0.00149 $0.00149
Haiku 4.5 $0.00075 $0.00075

Measured 2mo ago against content hash 084110a43300, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mcp-to-ai-sdk CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is mcp-to-ai-sdk, a CLI tool that generates Vercel AI SDK wrappers for Model Context Protocol (MCP) tools. It connects to MCP servers, discovers their tools, and generates type-safe TypeScript wrappers that can be used with the Vercel AI SDK.

Development Commands

# Build the CLI
npm run build

# Run the CLI directly (after building)
npm run dev <MCP_URL_OR_PATH>

# Test the built CLI
node dist/mcp-tools-cli.js https://mcp.grep.app

Architecture

Core Components

Main CLI File (mcp-tools-cli.ts)

  • Single-file CLI that handles all generation logic
  • Contains functions for connecting to MCP servers (HTTP/SSE/Stdio transports)
  • Generates three types of files for each MCP server

Generated Code Architecture The CLI generates a directory structure like mcps/mcp.grep.app/ with:

  1. client.ts - Shared MCP client with lazy connection

    • Uses singleton pattern with connection promise deduplication
    • Handles all transports: StreamableHTTP (default), SSE, or Stdio
    • Single persistent connection shared across all tools
  2. {toolName}.ts - Individual tool implementations

    • Each exports a {toolName}ToolWithClient factory function
    • Takes a client getter function as parameter for dependency injection
    • Uses json-schema-to-zod for automatic schema conversion
  3. index.ts - Convenience exports

    • Domain-based naming (e.g., mcpGrepTools for mcp.grep.app)
    • Two export patterns: default client and custom client injection
    • Individual tool re-exports for granular imports

Key Design Patterns

Tool Factory Pattern: Tools are generated as factory functions that accept a client getter, enabling both default shared client usage and custom client injection.

Domain-based Naming: Export names are generated from MCP URLs (e.g., mcp.grep.app → mcpGrep) with intelligent TLD and prefix stripping.

Read the full file on GitHub · 83 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 83 lines · 745 tokens per session scan A 084110a43300

Subscribe to this mod's changes

mcp-to-ai-sdk CLAUDE.md is an instructions file published in the GitHub repository vercel-labs/mcp-to-ai-sdk (123 stars, last pushed 1y ago), licensed Apache-2.0. It adds 745 tokens to every session, about $0.0030 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

mcp-to-ai-sdk CLAUDE.md compared with instructions from other repositories

mcp-to-ai-sdk CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mcp-to-ai-sdk CLAUDE.mdvercel-labs/mcp-to-ai-sdkInstructions file1231y agoApache-2.0A745Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode