TypeScript SDK
The official TypeScript SDK for Model Context Protocol servers and clients
What is TypeScript SDK?
TypeScript SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to official typescript sdk for model context protocol servers and clients
The official TypeScript SDK for Model Context Protocol servers and clients
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- The official TypeScript SDK for Model Context Protocol serve
Use Cases
Maintainer
Works with
Installation
NPM
npx -y @camsoft/mcp-sdkManual Installation
npx -y @camsoft/mcp-sdkConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use TypeScript SDK
The Model Context Protocol TypeScript SDK is the official library for building MCP servers and clients in TypeScript and JavaScript. It provides the core server runtime for registering tools, resources, and prompts, along with client transport implementations for stdio and Streamable HTTP, OAuth helpers, and middleware packages for Express, Hono, and Node.js HTTP. Any developer who wants to create a production-grade MCP server or build an application that connects to MCP servers should start here — it is the canonical reference implementation for the protocol in the Node.js ecosystem.
Prerequisites
- Node.js 18 or higher
- npm or yarn for package management
- TypeScript 5.x (for TypeScript projects; the SDK ships type definitions)
- An MCP-compatible client such as Claude Desktop or Claude Code for testing your server
- Familiarity with async/await JavaScript and basic TypeScript types
Install the SDK packages
Install the core MCP server and/or client packages from npm. Add optional middleware packages for your chosen web framework if you need HTTP transport.
npm install @modelcontextprotocol/sdk
# For HTTP middleware (optional):
npm install @modelcontextprotocol/express # Express.js
npm install @modelcontextprotocol/hono # Hono
npm install @modelcontextprotocol/node # Node.js HTTPCreate a minimal MCP server
Write a TypeScript file that creates an McpServer instance, registers tools using registerTool with a Zod input schema, and connects to a StdioServerTransport.
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import { z } from 'zod';
const server = new McpServer({ name: 'my-server', version: '1.0.0' });
server.registerTool(
'greet',
{ description: 'Greet someone by name', inputSchema: z.object({ name: z.string() }) },
async ({ name }) => ({ content: [{ type: 'text', text: `Hello, ${name}!` }] })
);
const transport = new StdioServerTransport();
await server.connect(transport);Add resources and prompts
Beyond tools, you can register resources (static or dynamic data the AI can read) and prompts (reusable prompt templates) using registerResource and registerPrompt on the server object.
Build and test the server locally
Compile the TypeScript server and verify it starts without errors. You can use MCP Inspector or connect it directly to Claude Desktop for testing.
npx tsc
node dist/index.jsAdd the server to your MCP client
Register your compiled server in claude_desktop_config.json to test it with Claude Desktop. Use the absolute path to the compiled entry point.
Explore the examples directory
The SDK repository includes complete runnable examples for both servers and clients in the examples/ directory. Clone the repo and run them to see the full API in action.
git clone https://github.com/modelcontextprotocol/typescript-sdk.git
cd typescript-sdk && npm install
npm run buildTypeScript SDK Examples
Client configuration
Add this block to your claude_desktop_config.json to connect Claude Desktop to a locally compiled MCP server built with the TypeScript SDK.
{
"mcpServers": {
"my-typescript-mcp-server": {
"command": "node",
"args": ["/absolute/path/to/your/dist/index.js"],
"env": {}
}
}
}Prompts to try
Use these prompts with Claude when testing an MCP server built with the TypeScript SDK.
- "What tools are available on this MCP server?"
- "Call the greet tool with name 'Alice'"
- "List all resources exposed by this server"
- "Use the available prompt templates to generate a response about [topic]"Troubleshooting TypeScript SDK
Server fails to start with 'Cannot find module' errors
Run `npm install` to install all dependencies, then `npx tsc` to compile TypeScript. Ensure the output path in dist/ matches what is referenced in claude_desktop_config.json. Check your tsconfig.json outDir setting.
Zod validation errors when registering tools
The SDK supports Zod v4, Valibot, and ArkType for input schemas via Standard Schema. Ensure you have `zod@^3` or `zod@^4` installed and that the schema matches the exact input structure your tool handler expects.
Claude Desktop connects but reports no tools
Verify your server calls `server.connect(transport)` and that registerTool calls are made before connect. Restart Claude Desktop after any changes to claude_desktop_config.json. Check the server logs for startup errors.
Frequently Asked Questions about TypeScript SDK
What is TypeScript SDK?
TypeScript SDK is a Model Context Protocol (MCP) server that official typescript sdk for model context protocol servers and clients It connects AI assistants to external tools and data sources through a standardized interface.
How do I install TypeScript SDK?
Install via npm with the command: npx -y @camsoft/mcp-sdk. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with TypeScript SDK?
TypeScript SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is TypeScript SDK free to use?
Yes, TypeScript SDK is open source and available under the NOASSERTION license. You can use it freely in both personal and commercial projects.
TypeScript SDK Alternatives — Similar Developer Tools Servers
Looking for alternatives to TypeScript SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up TypeScript SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use TypeScript SDK?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.