Skip to content

docs: Critical documentation refactor - fix 22 missing tools and outdated entity descriptions #24

@polaz

Description

@polaz

Summary

Iterative documentation refactor: migrate README.md content to VitePress static site on GitHub Pages, following MCP documentation best practices.

Current State Analysis:

  • README: 1122 lines, claims 62 tools
  • Reality: 47 tools (post-CQRS consolidation)
  • Existing: docs/TOOLS.md auto-generated, docs/setup-github-secrets.md, docs/public/CNAME

Iterative Process

Workflow for Each Section

┌─────────────────────────────────────────────────────────────────┐
│                    DOCUMENTATION ITERATION                       │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  1. EXTRACT section from README                                  │
│     └── Identify lines, topic, target page                       │
│                                                                  │
│  2. VERIFY against actual code                                   │
│     └── Check if feature exists, behavior matches                │
│     └── Run yarn list-tools, check schemas, test endpoints       │
│                                                                  │
│  3. DECISION POINT                                               │
│     ├── Code matches docs → Write documentation                  │
│     ├── Docs outdated → Update docs to match code                │
│     └── Code needs improvement → Create spin-off issue           │
│                                                                  │
│  4. WRITE documentation page                                     │
│     └── VitePress markdown in docs/ directory                    │
│                                                                  │
│  5. REMOVE processed content from README                         │
│     └── Leave only link to new location                          │
│                                                                  │
│  6. REPEAT until README is minimal (<200 lines)                  │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Spin-off Issue Protocol

When documentation reveals code problems:

  1. Identify the issue type:

    • 🐛 Bug: Code doesn't work as expected
    • 🎯 UX: Works but confusing for users
    • 📚 Gap: Feature missing documentation hooks
    • ⚠️ Inconsistency: Behavior differs from similar features
  2. Create independent issue:

  3. Document "as it should be":

    • Write documentation for ideal behavior
    • Note: "Implementation: see #XXX"
    • Continue with next section

README Section Breakdown

Phase 1: VitePress Foundation

  • Add VitePress dependency and config
  • Create docs/.vitepress/config.ts
  • Set up GitHub Pages workflow
  • Create home page hero
  • Add MCP Install Badges to home page hero (see MCP Install Badges section below)

Phase 2: Installation & Quick Start (Lines 22-188)

Section Lines Target Status
Header + badges 1-19 Keep minimal + add MCP install badges
Requirements 20-21 /guide/requirements.md
Codex config 26-35 /guide/installation/codex.md
npx config 37-63 /guide/installation/npm.md
VSCode mcp.json 66-92 /guide/installation/vscode.md
Docker stdio 101-148 /guide/installation/docker.md
Docker HTTP 151-188 /guide/installation/docker.md

Verification checklist:

  • Test npx @structured-world/gitlab-mcp actually works
  • Verify Docker image exists at ghcr.io/structured-world/gitlab-mcp:latest
  • Check all env vars mentioned are still valid
  • Verify USE_* flags list is complete
  • Test MCP install deeplinks work in VS Code, Cursor

Phase 3: Auto-Discovery (Lines 190-238)

Section Lines Target Status
Auto-discovery intro 190-208 /guide/configuration.md#auto-discovery
Config priority table 210-224 /guide/configuration.md#priority
How it works 226-238 /guide/configuration.md#auto-discovery

Verification checklist:

  • Test --auto flag behavior
  • Verify --dry-run output
  • Check priority order is accurate

Phase 4: Transport Modes (Lines 239-264)

Section Lines Target Status
Mode selection table 245-250 /guide/configuration.md#transport
HTTP vs stdio details 251-264 /guide/configuration.md#transport

Verification checklist:

  • Test PORT env triggers HTTP mode
  • Verify /sse and /mcp endpoints exist
  • Test stdio argument override

Phase 5: TLS/HTTPS (Lines 265-295)

Section Lines Target Status
TLS table 269-272 /advanced/tls.md
Direct TLS example 274-284 /advanced/tls.md#direct
Reverse proxy example 286-293 /advanced/tls.md#proxy

Verification checklist:

  • Test SSL_CERT_PATH and SSL_KEY_PATH work
  • Link to existing SSL.md if detailed

Phase 6: OAuth Authentication (Lines 297-509) ⚠️ COMPLEX

Section Lines Target Status
When to use table 301-308 /security/oauth.md#when-to-use
Prerequisites 310-315 /security/oauth.md#prerequisites
GitLab app setup 317-328 /security/oauth.md#gitlab-setup
Server config 330-350 /security/oauth.md#server-config
Deploy with HTTPS 352-368 /security/oauth.md#deployment
Claude Web setup 370-382 /security/oauth.md#claude-web
Claude Desktop setup 384-419 /security/oauth.md#claude-desktop
ASCII diagram 425-438 /security/oauth.md#architecture
OAuth vs Token table 454-463 /security/oauth.md#comparison
OAuth flows table 465-474 /security/oauth.md#flows
Endpoints table 476-488 /security/oauth.md#endpoints
Troubleshooting 490-509 /security/oauth.md#troubleshooting

⚠️ PRESERVE: ASCII diagram (lines 425-438) must be kept exactly!

Verification checklist:

  • Test OAUTH_ENABLED=true startup
  • Verify all OAuth endpoints exist
  • Test device flow works
  • Check GitLab 17.1+ requirement accuracy

Phase 7: Environment Variables (Lines 510-539)

Section Lines Target Status
Core env vars 512-521 /guide/configuration.md#environment
USE_* flags 521-532 /guide/configuration.md#feature-flags
SSL env vars 534-537 /advanced/tls.md#environment
TRUST_PROXY 538-539 /advanced/tls.md#reverse-proxy

Verification checklist:

  • Run yarn list-tools --env to get accurate env var list
  • Verify each USE_* flag enables correct tools
  • Check default values are accurate

Phase 8: Dynamic Descriptions (Lines 540-603)

Section Lines Target Status
Overview 540-550 /advanced/customization.md#descriptions
Format examples 551-571 /advanced/customization.md#format
JSON config example 573-591 /advanced/customization.md#example
Important notes 593-600 /advanced/customization.md#notes

Verification checklist:

  • Test GITLAB_TOOL_* actually works
  • Verify tool count in notes (says 59, should be 47)

Phase 9: Action Filtering (Lines 604-735)

Section Lines Target Status
GITLAB_DENIED_ACTIONS 604-630 /advanced/customization.md#action-filtering
How it works 631-639 /advanced/customization.md#action-filtering
Token savings example 641-649 /advanced/customization.md#token-savings
Action descriptions 659-681 /advanced/customization.md#action-descriptions
Parameter descriptions 683-703 /advanced/customization.md#param-descriptions
Schema mode 705-735 /advanced/customization.md#schema-mode

Verification checklist:

  • Test GITLAB_DENIED_ACTIONS filtering
  • Verify schema actually shrinks with denied actions

Phase 10: Tools Reference (Lines 736-934) ⚠️ OUTDATED

STATUS: MUST BE DELETED

Current README claims:

  • "62 Tools Available" ❌ Reality: 47
  • Lists 5 Label tools ❌ Reality: 2 CQRS
  • Lists 9 Milestone tools ❌ Reality: 2 CQRS
  • Lists 12 Pipeline tools ❌ Reality: 3 CQRS
  • Lists 5 Wiki tools ❌ Reality: 2 CQRS

Action:

  • Delete entire section
  • Replace with link to auto-generated /tools/ or TOOLS.md
  • Ensure yarn list-tools --export is accurate

Phase 11: CLI Tools (Lines 935-1040)

Section Lines Target Status
list-tools overview 935-950 /cli/list-tools.md
Usage examples 951-979 /cli/list-tools.md#usage
Generate TOOLS.md 981-1000 /cli/list-tools.md#export
Features 1002-1040 /cli/list-tools.md#features

Verification checklist:

  • Test all yarn list-tools commands
  • Verify --entity, --tool, --json flags work

Phase 12: Testing Section (Lines 1041-1086)

Section Lines Target Status
Running tests 1043-1058 CONTRIBUTING.md
Quick tool testing 1060-1076 CONTRIBUTING.md#testing
Test architecture 1078-1086 CONTRIBUTING.md#architecture

Action: Move to CONTRIBUTING.md (developer documentation, not user-facing)

Phase 13: Footer (Lines 1087-1122)

Section Lines Target Status
Support/donation 1087-1103 Keep in README
License 1104-1117 Keep in README
Attribution 1118-1122 Keep in README

VitePress Configuration

// docs/.vitepress/config.ts
import { defineConfig } from 'vitepress';

export default defineConfig({
  title: 'GitLab MCP',
  description: 'Model Context Protocol server for GitLab API',
  base: '/gitlab-mcp/',

  themeConfig: {
    nav: [
      { text: 'Guide', link: '/guide/' },
      { text: 'Tools', link: '/tools/' },
      { text: 'Security', link: '/security/' },
      { text: 'Advanced', link: '/advanced/' },
    ],

    sidebar: {
      '/guide/': [
        { text: 'Quick Start', link: '/guide/quick-start' },
        { text: 'Installation', collapsed: false, items: [
          { text: 'npm/npx', link: '/guide/installation/npm' },
          { text: 'Docker', link: '/guide/installation/docker' },
          { text: 'VS Code', link: '/guide/installation/vscode' },
          { text: 'Codex', link: '/guide/installation/codex' },
        ]},
        { text: 'Configuration', link: '/guide/configuration' },
      ],
      '/security/': [
        { text: 'OAuth', link: '/security/oauth' },
        { text: 'Token Safety', link: '/security/tokens' },
        { text: 'Read-Only Mode', link: '/security/read-only' },
      ],
      '/advanced/': [
        { text: 'TLS/HTTPS', link: '/advanced/tls' },
        { text: 'Customization', link: '/advanced/customization' },
        { text: 'Profiles & Presets', link: '/advanced/profiles' },
      ],
    },

    search: { provider: 'local' },
  },
});

GitHub Actions

# .github/workflows/docs.yml
name: Deploy Documentation

on:
  push:
    branches: [main]
    paths:
      - 'docs/**'
      - 'src/**'  # for coverage integration
  workflow_dispatch:

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: yarn
      - run: yarn install --frozen-lockfile
      - run: yarn docs:build
      - run: yarn test:cov
      - run: cp -r coverage/lcov-report docs/.vitepress/dist/coverage
      - uses: actions/upload-pages-artifact@v3
        with:
          path: docs/.vitepress/dist

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - uses: actions/deploy-pages@v4
        id: deployment

MCP Install Badges (One-Click Installation)

Overview

MCP Install Badges provide one-click installation experience for users. When clicked, these badges open the IDE and automatically configure gitlab-mcp as an MCP server.

Supported IDEs and Deeplink Formats

IDE Deeplink Format Badge Source
VS Code vscode:mcp/install?name=...&config=... shields.io
VS Code Insiders vscode-insiders:mcp/install?... shields.io
Cursor cursor://anysphere.cursor-deeplink/mcp/install?name=...&config=BASE64 cursor.com/deeplink
Visual Studio vs-open.link/mcp-install?... shields.io
Windsurf TBD (check codeium docs) shields.io

Implementation Options

Option A: Static Badges in README (Simplest)

Add manually crafted badges to README.md header:

<!-- One-Click Install Badges -->
[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_GitLab_MCP-007ACC?style=for-the-badge&logo=visualstudiocode&logoColor=white)](vscode:mcp/install?name=gitlab-mcp&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40structured-world%2Fgitlab-mcp%22%5D%7D)

[![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=gitlab-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBzdHJ1Y3R1cmVkLXdvcmxkL2dpdGxhYi1tY3AiXX0=)

Pros: Simple, no CI needed, works immediately
Cons: Config is URL-encoded/base64, hard to maintain, no version pinning

Option B: Generate Badges in CI (Recommended)

Add badge generation step to release workflow:

# .github/workflows/release.yml (add to existing)
- name: Generate MCP Install Badges
  run: |
    VERSION=${{ github.ref_name }}

    # VS Code config (URL-encoded JSON)
    VSCODE_CONFIG=$(node -e "console.log(encodeURIComponent(JSON.stringify({
      command: 'npx',
      args: ['-y', '@structured-world/gitlab-mcp@${VERSION}']
    })))")

    # Cursor config (base64-encoded JSON)
    CURSOR_CONFIG=$(echo -n '{"command":"npx","args":["-y","@structured-world/gitlab-mcp@'${VERSION}'"]}' | base64 -w0)

    # Generate badges markdown
    cat > docs/public/install-badges.md << EOF
    ## One-Click Install

    [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-007ACC?style=for-the-badge&logo=visualstudiocode)](vscode:mcp/install?name=gitlab-mcp&config=${VSCODE_CONFIG})

    [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](cursor://anysphere.cursor-deeplink/mcp/install?name=gitlab-mcp&config=${CURSOR_CONFIG})
    EOF

- name: Update README badges
  run: |
    # Script to update README.md badge section with latest version
    ./scripts/update-badges.sh ${{ github.ref_name }}

Pros: Version-pinned badges, auto-updated on release, maintainable
Cons: Requires CI setup, badges update only on release

Option C: Interactive Badge Generator Page on VitePress (Best UX)

Create a dedicated page on the documentation site:

docs/
└── install/
    └── index.md    # Interactive badge generator

docs/install/index.md:

# One-Click Install

<script setup>
import InstallBadges from '../.vitepress/components/InstallBadges.vue'
</script>

<InstallBadges />

## Manual Installation

If one-click install doesn't work, see [manual installation guide](/guide/installation/).

docs/.vitepress/components/InstallBadges.vue:

<template>
  <div class="install-badges">
    <div class="badge-row">
      <a :href="vscodeUrl" class="badge">
        <img src="https://img.shields.io/badge/VS_Code-Install-007ACC?style=for-the-badge&logo=visualstudiocode" />
      </a>
      <a :href="cursorUrl" class="badge">
        <img src="https://cursor.com/deeplink/mcp-install-dark.svg" />
      </a>
    </div>

    <details>
      <summary>Customize installation</summary>
      <div class="options">
        <label>
          <input type="checkbox" v-model="pinVersion" />
          Pin to version {{ latestVersion }}
        </label>
        <label>
          GitLab URL: <input v-model="gitlabUrl" placeholder="https://gitlab.com" />
        </label>
      </div>
    </details>

    <div class="copy-section">
      <h3>Copy badge markdown for your project:</h3>
      <pre><code>{{ badgeMarkdown }}</code></pre>
      <button @click="copy">Copy</button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      latestVersion: '6.29.1', // Fetched from npm or hardcoded
      pinVersion: false,
      gitlabUrl: ''
    }
  },
  computed: {
    config() {
      const pkg = this.pinVersion
        ? `@structured-world/gitlab-mcp@${this.latestVersion}`
        : '@structured-world/gitlab-mcp';
      return {
        command: 'npx',
        args: ['-y', pkg],
        ...(this.gitlabUrl && { env: { GITLAB_URL: this.gitlabUrl } })
      };
    },
    vscodeUrl() {
      return `vscode:mcp/install?name=gitlab-mcp&config=${encodeURIComponent(JSON.stringify(this.config))}`;
    },
    cursorUrl() {
      return `cursor://anysphere.cursor-deeplink/mcp/install?name=gitlab-mcp&config=${btoa(JSON.stringify(this.config))}`;
    },
    badgeMarkdown() {
      return `[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-007ACC?logo=visualstudiocode)](${this.vscodeUrl})`;
    }
  }
}
</script>

Pros: Best UX, customizable, always current version, copy-paste for users
Cons: Requires Vue component, more complex setup

Recommended Implementation Plan

Phase Task Where
Phase 1 Add static badges to README README.md
Phase 1 Add badges to VitePress home hero docs/index.md
Phase 2 Create CI step to update badges on release .github/workflows/release.yml
Phase 2 Create scripts/update-badges.sh scripts/
Phase 3 Build interactive badge generator page docs/install/index.md
Phase 3 Add Vue component for customization docs/.vitepress/components/

Badge Configuration Reference

VS Code / VS Code Insiders:

vscode:mcp/install?name=<server-name>&config=<url-encoded-json>

Config JSON structure:

{
  "command": "npx",
  "args": ["-y", "@structured-world/gitlab-mcp"],
  "env": {
    "GITLAB_URL": "https://gitlab.com"  // optional
  }
}

Cursor:

cursor://anysphere.cursor-deeplink/mcp/install?name=<server-name>&config=<base64-encoded-json>

Same config JSON, but base64-encoded instead of URL-encoded.

Testing Badges

Before deploying, test badges work:

  1. VS Code: Click badge, should open VS Code with MCP install prompt
  2. Cursor: Click badge, should open Cursor with config dialog
  3. Verify config: After install, check ~/.vscode/mcp.json or ~/.cursor/mcp.json

External Resources


Acceptance Criteria

  • VitePress site deployed to GitHub Pages
  • README reduced to <200 lines (overview + links)
  • All sections migrated to appropriate /docs/ pages
  • Tools section removed, replaced with link to TOOLS.md
  • No outdated tool counts (62->47 corrected everywhere)
  • OAuth ASCII diagram preserved exactly
  • Spin-off issues created for discovered code problems
  • Search works across documentation
  • Coverage integrated at /coverage/
  • CONTRIBUTING.md created with testing docs
  • MCP Install Badges added to README header
  • MCP Install Badges added to VitePress home page
  • Badge deeplinks tested in VS Code and Cursor

Related Issues

Track spin-off issues here as they are created:


References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions