MCP Example: Server over stdio
LocalAbout MCP Example: Server over stdio
MCP Example: Server over stdio is a small TypeScript example of an MCP server communicating over stdio. It is intended as a starting point for developers who want to extend the server with custom commands.
Key features
- 01stdio-based MCP server example
- 02Implemented in TypeScript
- 03Extensible for custom commands
Use cases
- 01Study a basic stdio server implementation
- 02Use as a base for custom MCP commands
MCP support
It demonstrates an MCP server that communicates over stdio and can be configured in Cursor.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Example: Server over stdio
This repository demonstrates a simple MCP (Model Context Protocol) server implementation that communicates over stdio using TypeScript.
Features
- Example MCP server using stdio
- Written in TypeScript
- Easily extensible for custom MCP commands
Prerequisites
- Node.js (v18 or newer recommended)
- npm
Setup
-
Install dependencies:
npm install -
Go to Cursor Settings -> MCP -> Add new MCP:
{ "mcpServers": { "Yes or No MCP": { "command": "npx", "args": [ "-y", "tsx", "<absolute_path_to>/stdio-example.ts", "--stdio" ] } } }Replace
<absolute_path_to>with the absolute path to yourstdio-example.tsfile. -
Use MCP server: Ask LLM in Cursor some question and add "yes or no" in the end, Cursor will call MCP tool.
File Overview
stdio-example.ts: Main MCP server implementation.copy-this-to-mcp-json.json: Example configuration for MCP server setup.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.