MCP TypeScript SDK

v1.0.0Developer Toolsstable

A toolkit for building Model Context Protocol servers and clients that provide standardized context for LLMs, allowing applications to expose resources, tools, and prompts through stdio or Streamable HTTP transports.

aiai-agentllmmcpmcp-client
Share:
97
Stars
0
Downloads
0
Weekly
0/5

What is MCP TypeScript SDK?

MCP TypeScript SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to toolkit for building model context protocol servers and clients that provide standardized context for llms, allowing applications to expose resources, tools, and prompts through stdio or streamable ht...

A toolkit for building Model Context Protocol servers and clients that provide standardized context for LLMs, allowing applications to expose resources, tools, and prompts through stdio or Streamable HTTP transports.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A toolkit for building Model Context Protocol servers and cl

Use Cases

MCP server and client building
HTTP and stdio transports
Resource and tool exposure
federated-alpha

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 13, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-typescript-sdk

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP TypeScript SDK

The MCP TypeScript SDK is the official reference implementation of the Model Context Protocol, enabling developers to build both MCP servers and clients in TypeScript. It provides all the building blocks needed to expose resources, tools, and prompts to LLM applications through standardized stdio or Streamable HTTP transports. Whether you are creating a new MCP server that surfaces data and actions to AI assistants or writing a client that consumes MCP services, this SDK handles protocol compliance, message routing, and lifecycle management so you can focus on your application logic.

Prerequisites

  • Node.js 18 or later installed
  • npm, yarn, or pnpm package manager
  • Basic TypeScript knowledge
  • An MCP-compatible client such as Claude Desktop or Claude Code to test your server
1

Install the SDK

Add the official MCP TypeScript SDK package to your project using your preferred package manager.

npm install @modelcontextprotocol/sdk
2

Create an MCP server instance

Import McpServer and create a named server instance. The name and version are sent to clients during the MCP handshake.

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"
});
3

Register tools

Use server.registerTool() to expose callable functions to AI assistants. Each tool has a name, description, typed input schema (via Zod), and an async handler that returns content.

server.registerTool(
  "add",
  {
    title: "Addition Tool",
    description: "Add two numbers",
    inputSchema: { a: z.number(), b: z.number() }
  },
  async ({ a, b }) => ({
    content: [{ type: "text", text: String(a + b) }]
  })
);
4

Register resources

Expose data to LLMs through resources. Static resources serve fixed URIs; ResourceTemplate enables dynamic URIs with named parameters.

import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";

server.registerResource(
  "greeting",
  new ResourceTemplate("greeting://{name}", { list: undefined }),
  { title: "Greeting Resource", description: "Dynamic greeting" },
  async (uri, { name }) => ({
    contents: [{ uri: uri.href, text: `Hello, ${name}!` }]
  })
);
5

Connect a transport and start the server

For local stdio usage (Claude Desktop, Claude Code), use StdioServerTransport. For HTTP deployments, use the Streamable HTTP transport. Call server.connect() to begin handling messages.

const transport = new StdioServerTransport();
await server.connect(transport);
6

Configure your MCP client

Add the compiled server to your MCP client configuration. Build your TypeScript project first with tsc or a bundler, then point the client at the output JS file.

MCP TypeScript SDK Examples

Client configuration

Claude Desktop config referencing a compiled MCP server built with the TypeScript SDK. Replace the path with the actual output location of your compiled index.js.

{
  "mcpServers": {
    "my-server": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"]
    }
  }
}

Prompts to try

Once your server is connected to an MCP client, try asking your AI assistant to use the tools and resources you registered.

- "Use the add tool to calculate 142 plus 858"
- "Read the greeting resource for the name Alice"
- "List all available tools on the connected MCP server"
- "What resources does this server expose?"

Troubleshooting MCP TypeScript SDK

Server exits immediately with no output

Make sure you await server.connect(transport) and that the entry point file is being run with Node.js 18+. For stdio transport the process must stay alive; avoid process.exit() or unhandled promise rejections.

Client reports 'tool not found' even though you registered it

Ensure registerTool() is called before server.connect(). Tools registered after connect() may not appear in the initial capability negotiation with some clients.

TypeScript compilation errors with Zod schemas in inputSchema

The SDK expects plain Zod schemas, not z.object() wrappers, for the inputSchema field. Pass { fieldName: z.type() } directly rather than wrapping in z.object().

Frequently Asked Questions about MCP TypeScript SDK

What is MCP TypeScript SDK?

MCP TypeScript SDK is a Model Context Protocol (MCP) server that toolkit for building model context protocol servers and clients that provide standardized context for llms, allowing applications to expose resources, tools, and prompts through stdio or streamable http transports. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP TypeScript SDK?

Follow the installation instructions on the MCP TypeScript SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP TypeScript SDK?

MCP TypeScript SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP TypeScript SDK free to use?

Yes, MCP TypeScript SDK is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

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.

Quick Config Preview

{ "mcpServers": { "mcp-typescript-sdk": { "command": "npx", "args": ["-y", "mcp-typescript-sdk"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP 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.

33,000+ ServersFree & Open SourceStep-by-Step Guides