MCP Simple Server

MCP Simple Server

A simple server implementing the Model Context Protocol for document search

Omerisra6

Developer Tools
Visit Server

README

MCP Simple Server

A simple server implementing the Model Context Protocol (MCP).

Setup

  1. Install dependencies:
npm install
  1. Start the server:
npm start

The server will run on http://localhost:3001 by default.

Using the Stdio Server

This project includes a stdio-based implementation of the MCP server that communicates via standard input/output instead of HTTP/SSE.

Running the Stdio Server

npm run stdio

The stdio server accepts JSON-RPC messages via stdin and responds via stdout. All logs are sent to stderr to avoid interfering with the JSON-RPC messages.

Using the MCP Inspector

If you want to use the MCP Inspector with the stdio server, we've created a bridge that connects the HTTP-based inspector to our stdio server:

npm run bridge

This will:

  1. Start the stdio server as a child process
  2. Create an HTTP server on port 3001
  3. Forward JSON-RPC requests from HTTP to the stdio server
  4. Return responses back to the HTTP clients

You can then connect the MCP Inspector to http://localhost:3001 and it will work with the stdio server.

Using the Interactive CLI

An interactive command-line interface is provided for easy interaction with the stdio server:

npm run cli

This will start an interactive shell where you can enter search queries:

MCP CLI - Interactive interface to the MCP server
Type "exit" or press Ctrl+C to quit
Examples:
  documents/javascript - Search for documents with keyword "javascript"
  help - Show this help message
--------------------------------------------------
> 

You can enter simple keywords or full document URIs to search.

Using the Sample Client

A sample client is included to demonstrate how to communicate with the stdio server programmatically:

npm run client <query>

For example:

npm run client javascript

This will:

  1. Start the stdio server as a child process
  2. Send a query for documents matching "javascript"
  3. Display the results and exit

Communicating Directly with the Stdio Server

You can also communicate directly with the stdio server by piping JSON-RPC messages:

echo '{"jsonrpc":"2.0","id":"1","method":"mcp.uri","params":{"uri":"documents/sample"}}' | node stdio-server.mjs

Custom Domain Setup

You can access the server via a custom domain by mapping it in your hosts file.

Automatic Setup

Run the included setup script with sudo permissions:

sudo ./hosts-setup.sh

This will add mcp.local to your hosts file pointing to 127.0.0.1 and flush your DNS cache.

Manual Setup

  1. Edit your hosts file:

    • On macOS/Linux: /etc/hosts
    • On Windows: C:\Windows\System32\drivers\etc\hosts
  2. Add the following line:

127.0.0.1 mcp.local
  1. Flush your DNS cache:

    • On macOS: sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
    • On Windows: ipconfig /flushdns
    • On Linux: Depends on your distribution
  2. Access the server at http://mcp.local:3001

Environment Variables

You can customize the server by setting the following environment variables:

  • PORT: The port to run the server on (default: 3001)
  • DOMAIN_NAME: The custom domain name (default: mcp.local)
  • SERVER_IP: The IP address to bind to (default: 127.0.0.1)

Example:

PORT=8080 DOMAIN_NAME=myapi.local npm start

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
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
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python