learn-typescript-mcp

learn-typescript-mcp

A monorepo for learning the Model Context Protocol with TypeScript, featuring example MCP servers for weather data and tax calculation.

Category
Visit Server

README

learn TypeScript MCP

Learning monorepo for the Model Context Protocol TypeScript SDK, built on Bun workspaces. Each learning topic lives in its own app under apps/ — new topics get a new apps/<topic> workspace.

App What it is
apps/weather/ The MCP weather tutorial, restructured as a NestJS application (running on the Bun runtime)
apps/tax-assistant/ A minimal plain-TypeScript stdio MCP server (VAT calculator)

To install dependencies for all workspaces:

bun install

Weather app (apps/weather/) — NestJS + MCP

Follows the official MCP TypeScript SDK "Build your first server" / "Build your first client" tutorials, using the real NWS weather API — hosted inside a NestJS app.

Both tools declare default values in their input schemas for development convenience — Inspector pre-fills its form with them (state: CA, latitude/longitude: San Francisco), so you can hit "Run Tool" without typing. Callers that pass their own arguments override them; the defaults only apply when an argument is omitted.

Run the stdio server

Each client that connects (Claude Code, Inspector, client.ts) spawns its own private copy of this process — it's not a shared server.

bun run weather:stdio

Run the HTTP server

One shared process that clients connect to over the network. Kill this terminal and every connected client loses the connection immediately.

bun run weather:http

Run the example client

bun run weather:client

Run the tests / typecheck

bun test          # from apps/weather/ (or the repo root)
bun run typecheck # from the repo root — tsc over both apps

Tax assistant (apps/tax-assistant/)

Minimal stdio MCP server with a single calculate-vat tool (Thai VAT 7%):

bun run tax:stdio

Inspect/test with MCP Inspector

bunx @modelcontextprotocol/inspector

Opens a browser UI (proxy on port 6277, UI on port 6274). In the sidebar, connect it either way:

  • stdio: Transport Type STDIO, Command bun, Args apps/weather/src/stdio.ts
  • HTTP: Transport Type Streamable HTTP, URL http://localhost:3000/mcp — requires the HTTP server (bun run weather:http) to already be running

Inspector remembers your last-used connection in the browser and auto-reconnects with it on load/refresh — always check the sidebar's Transport Type/URL before assuming what it's actually connected to.

If you get PORT IS IN USE on 6274/6277, a previous Inspector instance didn't shut down cleanly (it can leave its proxy process orphaned even after reporting failure). Find and kill it before retrying:

lsof -nP -iTCP:6274,6277 -sTCP:LISTEN
kill <PID>

Connect to Claude Code

.mcp.json registers the weather server, pointed at the HTTP transport — start the Nest server (bun run weather:http) yourself before opening a Claude Code session here, or /mcp will show it disconnected.

NestJS-on-Bun notes

  • No nest-cli/webpack build step — Bun runs the TypeScript entrypoints directly (bun src/main.ts).
  • tsconfig.json enables experimentalDecorators + emitDecoratorMetadata; Bun's transpiler honors both, which is what makes Nest constructor injection work.
  • Nest still uses its Express adapter internally; only the runtime and package manager are Bun.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured