Development

Prerequisites

  • Supported OS: macOS (tested), Linux (expected), Windows (expected)

  • Node.js: 22.x or higher (LTS recommended)

  • npm: Latest version

  • GitBook API token: Get from GitBook

Installation

git clone https://github.com/rickysullivan/gitbook-mcp.git
cd gitbook-mcp
npm install
npm run setup
# Add your GITBOOK_API_TOKEN to .env.local (for local development only)

Development

npm run dev

Debugging

DEBUG=1 npm run dev

VS Code MCP Integration (Development)

To use this MCP server in VS Code for development:

  • Use node as the command when running locally. The first argument should be the path to the compiled JavaScript output (e.g., dist/index.js).

{
    "servers": {
        "gitbook-mcp-dev": {
            "type": "stdio",
            "command": "node",
            "args": [
                "/my/path/to/gitbook-mcp/dist/index.js",
                "--organization-id=your_organization_id"
            ],
            "env": {
                "GITBOOK_API_TOKEN": "gb_api_your_token_here"
            }
        }
    }
}

For production or published usage, use npx instead of node:

{
    "servers": {
        "gitbook-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": ["gitbook-mcp", "--organization-id=your_organization_id"],
            "env": {
                "GITBOOK_API_TOKEN": "gb_api_your_token_here"
            }
        }
    }
}

Testing

There are currently no unit or integration tests; running npm run test only checks that the TypeScript code compiles successfully.

npm run test

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Submit a pull request