MCP TS Quickstart logo

MCP TS Quickstart

by cephalization

This is a quickstart for MCP (Model Context Protocol) in TypeScript. It includes a basic MCP server implementation that uses the `stdio` transport and fetches the top stories from Hacker News.

View on GitHub

Last updated: N/A

What is MCP TS Quickstart?

This is a quickstart template for building MCP servers using TypeScript. It provides a basic, functional server that retrieves top stories from Hacker News, demonstrating how to implement MCP with TypeScript without a build step, leveraging Node v23.

How to use MCP TS Quickstart?

  1. Clone the repository. 2. Install Node.js version 23 using nvm install && nvm use. 3. Install dependencies using pnpm install. 4. Configure Claude Desktop to use the server by providing the path to the index.ts file. 5. Alternatively, use pnpm start to run the server with the MCP Inspector UI.

Key features of MCP TS Quickstart

  • Basic MCP server implementation

  • Uses stdio transport

  • Fetches top stories from Hacker News

  • Written in TypeScript without a build step (Node v23)

  • Includes example tool implementation

Use cases of MCP TS Quickstart

  • Quickly setting up a new MCP server

  • Learning how to implement MCP in TypeScript

  • Extending the server with custom tools

  • Integrating with Claude Desktop or other MCP clients

FAQ from MCP TS Quickstart

How do I add a new tool to the server?

Copy the topStories tool in src/tools.ts and modify it to implement your desired functionality. Remember to use the .ts extension when importing local files.

Why do I need to use Node v23?

Node v23 allows running TypeScript files directly without a build step, simplifying the quickstart process.

How do I restart the server during development?

If using the MCP Inspector, you can simply press the 'Restart' button in the UI. Otherwise, you'll need to manually restart the Node.js process.

What is the MCP Inspector?

The MCP Inspector is a UI for interacting with MCP servers. It allows you to send requests and view responses.

Where can I find more information about MCP?

Refer to the official MCP documentation at https://modelcontextprotocol.io/.