MCP Server

0.0.9 · abandoned · verified Sun Apr 19

The `mcp-server` package provides a basic implementation of a JSON-RPC 2.0 server adhering to the Model-Client-Protocol (MCP). Released as version 0.0.9, this package was last published over five years ago and is no longer actively maintained. Its core functionality includes a JSON-RPC 2.0 compliant server with CORS enabled and a built-in echo tool. While it historically provided a simple entry point for the MCP, the broader Model-Client-Protocol ecosystem has evolved significantly with numerous actively developed frameworks and servers offering expanded features, transports, and modern development practices. This specific package should be considered for historical reference or very simple, isolated use cases, and not for new development requiring stability, security updates, or advanced MCP features.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to run the `mcp-server` using its command-line interface via `npx`.

const { createServer } = require('mcp-server');

const server = createServer();

// Start the server on the default port (4333) or specified port
// The original package's `createServer` expects to be run directly
// or via its CLI; programmatic starting requires more context from
// the original source, but a typical usage would involve a listen call.
// The package's `index.js` sets up CLI arguments for the port.
// For programmatic use, one would typically extend or wrap its components.
// This example shows how to run it as a CLI tool as per the README:

console.log('To run the MCP server, use the CLI:');
console.log('  npx mcp-server');
console.log('This will start the server on port 4333 (default).');
console.log('\n// For programmatic control, further investigation into the 0.0.9 source is needed.');
console.log('// A simple programmatic start for a typical HTTP server might look like this (conceptual):');
console.log('// server.listen(4333, () => console.log(\'MCP server listening on port 4333\'));');
// A more direct interpretation of the original source is that `createServer` returns a function that sets up the HTTP server itself, rather than an Express-like app.
// Given its abandonment, directly using the CLI is the most documented path.

view raw JSON →