mcpField
M
MCP Example: Server over stdio

MCP Example: Server over stdio

Local
github.com/a-polishchukDeveloper Tools0Updated 73w ago

About 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

  1. 01stdio-based MCP server example
  2. 02Implemented in TypeScript
  3. 03Extensible for custom commands

Use cases

  1. 01Study a basic stdio server implementation
  2. 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.

mcp.json · Universal config
{
"mcpServers": {
"example-stdio": {
"command": "npx",
"args": [
"-y",
"tsx"
]
}
}
}
Run commandnpx -y tsx

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmtsx

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP 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

  1. Install dependencies:

    npm install
    
  2. 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 your stdio-example.ts file.

  3. 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

Markdown supported

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.