Skip to content
Agent

MCP TypeScript SDK ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk) ![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fsdk)

by rakeshgangwar

AI Summary

The MCP TypeScript SDK enables developers to build and integrate Model Context Protocol servers and clients, allowing applications to provide standardized context to LLMs. It's essential for developers building AI-powered applications that need to expose resources, tools, and prompts in a protocol-compliant way.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to set up the "MCP TypeScript SDK ![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk) ![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fsdk)" agent in my project.

Please run this command in my terminal:
# Add AGENTS.md to your project root
curl --retry 3 --retry-delay 2 --retry-all-errors -o AGENTS.md "https://raw.githubusercontent.com/rakeshgangwar/30Days30Agents/main/agents/Day-08-Finance-Tracker/actual-mcp/docs/mcp/typescript-sdk.md"

Then explain what the agent does and how to invoke it.

Description

- [Overview](#overview)

Overview

The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements the full MCP specification, making it easy to: • Build MCP clients that can connect to any MCP server • Create MCP servers that expose resources, prompts and tools • Use standard transports like stdio and Streamable HTTP • Handle all MCP protocol messages and lifecycle events

Tools

Tools let LLMs take actions through your server. Unlike resources, tools are expected to perform computation and have side effects: `typescript // Simple tool with parameters server.tool( "calculate-bmi", { weightKg: z.number(), heightM: z.number() }, async ({ weightKg, heightM }) => ({ content: [{ type: "text", text: String(weightKg / (heightM * heightM)) }] }) ); // Async tool with external API call server.tool( "fetch-weather", { city: z.string() }, async ({ city }) => { const response = await fetch(https://api.weather.com/${city}); const data = await response.text(); return { content: [{ type: "text", text: data }] }; } ); `

Table of Contents

• Overview • Installation • Quickstart • What is MCP? • Core Concepts • Server • Resources • Tools • Prompts • Running Your Server • stdio • Streamable HTTP • Testing and Debugging • Examples • Echo Server • SQLite Explorer • Advanced Usage • Low-Level Server • Writing MCP Clients • Server Capabilities • Proxy OAuth Server • Backwards Compatibility

Installation

`bash npm install @modelcontextprotocol/sdk `

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 10mo ago
Stale
AdoptionUnder 100 stars
4 ★ · Niche
DocsMissing or thin
Undocumented

GitHub Signals

Stars4
Forks3
Issues0
Updated10mo ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code
Claude.ai