NPM MCP Server is a Model Context Protocol server implementation for NPM. It provides a standardized way to integrate with AI tools and services through the Model Context Protocol, specifically designed for NPM package management contexts.
- Node.js
- TypeScript
- Express
- Model Context Protocol SDK
- Commander
- Node.js (>=18.20.3 <19.0.0 || >=20.14.0 <21.0.0)
You can directly use the NPM MCP Server without installing it locally via npx
:
npx @coze-arch/npm-mcp-server@latest serve
This will start the MCP server on port 3000 by default. You can access it at http://localhost:3000/sse
.
To configure this MCP server in Cursor:
- Open Cursor IDE
- Go to Settings (
Ctrl+,
orCmd+,
) - Search for "MCP" in the settings search bar
- Under "Model Context Protocol", add a new MCP server with the following URL:
http://localhost:3000/sse
- Save your settings and restart Cursor
{
"mcpServers": {
"npm-mcp": {
"type": "http",
"url": "http://localhost:3000/sse"
}
}
}
Cursor should now be able to communicate with the NPM MCP server to provide context-aware assistance for your NPM projects.
The NPM MCP Server can be run in two different modes:
Start the server to listen on HTTP requests using npx:
npx @coze-arch/npm-mcp-server@latest serve
You can specify a different port:
npx @coze-arch/npm-mcp-server@latest serve --port 4000
Access the server at: http://localhost:<port>/sse
Run the server directly in the terminal:
npx @coze-arch/npm-mcp-server@latest start
If you're developing the MCP server yourself:
- Clone the repository
git clone https://github.com/coze-dev/rush-arch.git
- Navigate to the project directory
cd rush-arch/mcp/npm
- Install dependencies using Rush (recommended for monorepo):
rush update
- Build the project:
npm run build
- Run tests:
npm run test
- Check test coverage:
npm run test:cov
- [x] Basic MCP server implementation
- [x] HTTP server mode
- [x] Terminal mode
- [ ] Enhanced documentation
- [ ] Additional NPM-specific MCP features
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/amazing-feature
) - Commit your Changes (
git commit -m 'Add some amazing feature'
) - Push to the Branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
file for more information.