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.
npm install mcp-serverVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to run the `mcp-server` using its command-line interface via `npx`.
For new projects or existing projects requiring a stable, secure, and modern MCP server, consider actively maintained alternatives like `mcp-framework` or `@modelcontextprotocol/server-everything`.
Review the source code if using this package to understand and tighten CORS policies if necessary. For any production environment, migrate to a supported MCP server solution.
If programmatic use is required in an ESM project, you might need to use `createRequire` from the `module` module in Node.js, or configure your bundler (e.g., Webpack, Rollup) to handle CJS modules. However, migration to a modern MCP framework is strongly recommended.
Evaluate your specific MCP requirements. If you need advanced features, broader compatibility, or robust error handling, this package will be insufficient. Explore `mcp-framework`, `@modelcontextprotocol/sdk`, or other specialized MCP servers for more capable solutions.
Ensure no other applications are using port 4333. You can either stop the conflicting process or specify a different port when starting the `mcp-server` CLI (e.g., `npx mcp-server --port 8080`).
Ensure your project is configured as CommonJS if you are using `require()`, or use dynamic `import()` if you are in an ESM context and need to load a CJS module. For this specific package, stick to `const { createServer } = require('mcp-server');`.Ensure you are using the correct CommonJS named import syntax: `const { createServer } = require('mcp-server');`. Do not use `const createServer = require('mcp-server');` as it will try to assign the entire `module.exports` object to `createServer`.No dependency data recorded yet.