@mcp-monorepo/npm
v1.2.0
Published
MCP server for npm command tools (run scripts, install packages, list scripts)
Readme
@mcp-monorepo/npm
MCP server for npm command tools (run scripts, install packages, list scripts)
This package provides a set of tools to interact with Node.js projects using the npm command-line interface. It allows a model to perform common development tasks like installing dependencies, running scripts, and inspecting the project's configuration, all within a specified working directory.
Key Features
- Run npm Scripts: Execute any script defined in
package.jsonusing thenpm-runtool, with support for passing arguments. - Manage Dependencies: Use the
npm-installtool to install all project dependencies or add new packages, including support for development dependencies. - Inspect Scripts: The
list-scriptstool can read thepackage.jsonfile and return a list of all available npm scripts. - Monorepo Support: All tools include an optional
workspaceparameter, allowing them to target specific packages within a monorepo. - Safe Execution: Commands are executed in isolated child processes within the designated project directory, capturing all output (
stdout,stderr) and the exit code.
Usage
You can run this MCP server directly using npx for local testing:
npx @mcp-monorepo/npm@latestTo integrate this server with a compatible AI model (like Claude), provide the following MCP server configuration:
{
"mcpServers": {
"npm": {
"command": "npx",
"args": [
"-y",
"@mcp-monorepo/npm"
],
"env": {
"NPM_WORKING_DIRECTORY": "<Your NPM_WORKING_DIRECTORY Here>"
}
}
}
}Environment Variables
| Variable | Description | Default |
| :--- | :--- | :--- |
| NPM_WORKING_DIRECTORY | The absolute or relative path to the root of the Node.js project where npm commands will be executed. | <required> |
Tools
list-scripts
List npm scripts - Lists all available npm scripts defined in the project's package.json file. Optionally specify a workspace (relative path to package.json).
Input Schema
| Property | Type | Description |
| :--- | :--- | :--- |
| workspace | string | Relative path to the package.json for a monorepo workspace |
npm-run
Run npm script - Runs an npm script in the current workin directory
Input Schema
| Property | Type | Description |
| :--- | :--- | :--- |
| scriptName | string | The name of the npm script to run (e.g., "start", "test"). |
| args | string | Arguments to pass to the npm script as string. Seperated by spaces. |
| workspace | string | Relative path to the package.json for a monorepo workspace |
npm-install
Install npm packages - Installs npm packages with optional dev dependency and workspace support
Input Schema
| Property | Type | Description |
| :--- | :--- | :--- |
| packageName | string | The name of the package to install. If not provided, installs all dependencies from package.json. |
| isDev | boolean | Whether to install as a dev dependency (adds --save-dev flag) |
| workspace | string | Relative path to the package.json for a monorepo workspace |
Other MCP Servers
This monorepo contains several other MCP server packages available on npm. Each provides a distinct set of tools for use with the Model Context Protocol.
- @mcp-monorepo/confluence: MCP server for Confluence API tools
- @mcp-monorepo/file-browser: MCP server for file system browsing and manipulation (search, ls, tree, grep, open, write, move, mkdir)
- @mcp-monorepo/ics: MCP server for calendar tools using ICS/ical feeds
- @mcp-monorepo/jira: MCP server for Jira tools (JQL, issue management, etc.).
- @mcp-monorepo/location: MCP server for location-based tools using IP address lookup
- @mcp-monorepo/mail: MCP server for mail tools (fetch, read, search, mark as seen).
- @mcp-monorepo/notion-query: MCP server for querying Notion data sources.
- @mcp-monorepo/slack: Slack MCP to access workspace without bot account or app
- @mcp-monorepo/weather: Weather MCP tools (geocoding, weather-by-coords) for ModelContextProtocol.
Recent Changes
Version 1.1.4
- fd22b00: Fixed yarn versioning during publish
Version 1.1.3
- Updated dependencies [7929a55]
Version 1.1.2
- 75e8973: migrate monorepo to yarn 4, update CI/husky/scripts and run-on-changed, add yarnrc and packageManager, switch internal deps to workspace:* and simplify bin fields
Authors
- The MCP Monorepo Team
License
This project is licensed under the AGPL-3.0-only License. See the LICENSE file for details.
