This NPM package provides a server that adheres to the Model Context Protocol (MCP), allowing markdown documentation from NPM packages, Go Modules, or PyPi packages to be exposed for use with AI-assisted coding tools. It helps create better code generation experiences by providing contextual documentation to AI tools.
You can run the server directly using npx without installation:
npx -y markdown-sidecar-mcp
The server accepts the following configuration parameters:
workingDir
: The working directory of your repositorypackageName
: The name of the package or module to requestregistry
: Package registry type (npm
, gomodules
, or pypi
)docsSubDir
: (Optional) Specific subdirectory to look for markdown docs (defaults to package root)mcpPrimitive
: (Optional) MCP primitive to expose (tool
or resource
, defaults to tool
)To use this server with the Cursor editor, add a server definition to your .cursor/mcp.json
file:
{
"mcpServers": {
"sidecar": {
"command": "npx",
"args": [
"-y", "--package", "markdown-sidecar-mcp",
"--",
"mcp", "start",
"--workingDir", "{REPO_WORKING_DIR}",
"--packageName", "{PACKAGE_NAME}",
"--registry", "npm"
]
}
}
}
To serve documentation for a specific NPM package:
npx -y markdown-sidecar-mcp mcp start --workingDir ./my-project --packageName react --registry npm
For Go modules:
npx -y markdown-sidecar-mcp mcp start --workingDir ./my-go-project --packageName github.com/gorilla/mux --registry gomodules
For Python packages:
npx -y markdown-sidecar-mcp mcp start --workingDir ./my-python-project --packageName requests --registry pypi
If documentation is in a specific subdirectory:
npx -y markdown-sidecar-mcp mcp start --workingDir ./my-project --packageName lodash --registry npm --docsSubDir docs
To expose the documentation as a resource instead of a tool:
npx -y markdown-sidecar-mcp mcp start --workingDir ./my-project --packageName express --registry npm --mcpPrimitive resource
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "sidecar" '{"command":"npx","args":["-y","--package","markdown-sidecar-mcp","--","mcp","start","--workingDir","{REPO_WORKING_DIR}","--packageName","{PACKAGE_NAME}","--registry","npm"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"sidecar": {
"command": "npx",
"args": [
"-y",
"--package",
"markdown-sidecar-mcp",
"--",
"mcp",
"start",
"--workingDir",
"{REPO_WORKING_DIR}",
"--packageName",
"{PACKAGE_NAME}",
"--registry",
"npm"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"sidecar": {
"command": "npx",
"args": [
"-y",
"--package",
"markdown-sidecar-mcp",
"--",
"mcp",
"start",
"--workingDir",
"{REPO_WORKING_DIR}",
"--packageName",
"{PACKAGE_NAME}",
"--registry",
"npm"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect