Skip to content

Ship a TypeScript "Code Mode" client SDK sample under client/code-mode-ts/ #142

Description

@sajeetharan

Motivation

The Anthropic Code Execution with MCP post shows agents importing each MCP tool as a typed TS function (./servers/<server>/<tool>.ts). Providing an official mirror for MCPToolkit makes onboarding trivial for Code-Mode agent hosts (Claude Code, Cloudflare Workers, Foundry, Copilot Studio, etc.).

Proposal

New folder client/code-mode-ts/:

client/code-mode-ts/
  package.json
  tsconfig.json
  src/
    client.ts               // callMCPTool() wrapper (fetch + bearer auth)
    servers/cosmos-db/
      index.ts
      listDatabases.ts
      listCollections.ts
      getApproximateSchema.ts
      getRecentDocuments.ts
      findDocumentById.ts
      textSearch.ts
      vectorSearch.ts
      hybridSearch.ts
  README.md                 // usage + link to CODE-MODE.md

Each file exports one typed async function that calls the corresponding MCP tool.

Acceptance criteria

  • Compiles with tsc --strict
  • Auth via bearer token from env variable
  • Basic smoke script that calls list_databases against the deployed sample
  • README with copy-paste quick start

Related

Mirrors the existing Python client under client/. Part of the "Code Mode" support umbrella.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions