Skip to main content
Glama
Confluence API Docs MCP Server

Confluence API Docs MCP Server

by saleshandy

Confluence API Docs MCP Server

An MCP (Model Context Protocol) server that generates API documentation in Confluence from:

  • Swagger/OpenAPI specifications (JSON files or URLs)

  • NestJS controller files (TypeScript decorators)

Automatically generates Postman collections and embeds them in documentation pages.

Installation

npm install
npm run build

Related MCP server: Confluence MCP Server

Configuration

  1. Copy .env.example to .env

  2. Fill in your Confluence Cloud credentials:

  3. Add to ~/.claude.json:

{
  "mcpServers": {
    "confluence-api-docs": {
      "command": "node",
      "args": ["/home/harsh-vaghela/saleshandy/confluence-api-docs-mcp/dist/index.js"],
    }
  }
}

Usage

Available Tools

Space Management:

  • list_spaces - List all Confluence spaces

  • search_pages - Search for existing pages

  • get_page - Get page content

  • delete_page - Delete a page

Swagger/OpenAPI Documentation:

  • create_api_doc - Create API documentation from Swagger/OpenAPI spec (URL or file)

  • update_api_doc - Update existing API documentation from spec

  • sync_swagger_to_confluence - Full sync with configurable grouping (tag, path, or single page)

NestJS Controller Documentation:

  • create_api_doc_from_controller - Create documentation from NestJS controller files

  • update_api_doc_from_controller - Update documentation from controller files

Note: All tools automatically generate Postman collections embedded in the documentation.

Examples

List available spaces:

Show me available Confluence spaces

Create API docs from Swagger:

Create API documentation in space DEV from http://localhost:3000/swagger.json

Create API docs from NestJS controller:

Create API documentation from src/controllers/dialer.controller.ts in space DEV with base URL https://api.example.com

Create docs from controller directory:

Create API documentation from src/controllers in space DEV

Update API docs:

Update page 12345678 with latest API spec from /path/to/swagger.json

Update from controller:

Update page 12345678 from src/controllers/dialer.controller.ts

Development

npm run dev          # Run with ts-node
npm run build        # Build to dist/
npm start            # Run compiled version
npm run clean        # Remove dist/

Architecture

MCP Server
  ├── Parsers
  │   ├── Swagger Parser Service
  │   │   └── Parses OpenAPI specs from URLs or files
  │   └── Controller Parser Service
  │       └── Parses NestJS TypeScript controller files
  ├── Generators
  │   ├── Doc Generator Service
  │   │   └── Converts parsed specs to Confluence storage format
  │   └── Postman Generator Service
  │       └── Generates Postman Collection v2.1 JSON
  ├── Confluence Client Service
  │   └── Handles Confluence REST API v2 calls
  └── Tools
      ├── Space Management
      ├── Swagger-based Documentation
      ├── Controller-based Documentation
      └── Maintenance

Dual-Mode Pipeline

Both Swagger and Controller inputs converge to the same ParsedSwagger format, ensuring identical output documentation:

Swagger JSON/URL → Swagger Parser → ParsedSwagger ─┐
                                                    ├→ Doc Generator → Confluence HTML + Postman JSON
NestJS Controller → Controller Parser → ParsedSwagger ┘

Supported Swagger/OpenAPI Versions

  • OpenAPI 3.0.x

  • OpenAPI 3.1.x

  • Swagger 2.0

License

MIT

Available Tools

9 tools
create_api_docC

Create a new API documentation page from a Swagger/OpenAPI specification

Inputs: spaceKey (required), swaggerSource (required), title, filterTags, +2 more.

create_api_doc_from_controllerC

Create a new API documentation page from NestJS controller files

Inputs: spaceKey (required), controllerPath (required), title, baseUrl, +3 more.

delete_pageC

Delete a Confluence page

Inputs: pageId (required).

get_pageA

Get the content of an existing Confluence page

Inputs: pageId (required).

list_spacesA

List all available Confluence spaces

Inputs: no named parameters.

search_pagesC

Search for existing pages in Confluence

Inputs: query (required), spaceKey.

sync_swagger_to_confluenceC

Sync a Swagger/OpenAPI spec to Confluence, optionally creating nested pages

Inputs: spaceKey (required), swaggerSource (required), groupBy, parentPageId.

update_api_docB

Update an existing API documentation page with new Swagger/OpenAPI spec

Inputs: pageId (required), swaggerSource (required), filterTags, filterPaths.

update_api_doc_from_controllerB

Update an existing API documentation page with NestJS controller files

Inputs: pageId (required), controllerPath (required), baseUrl, filterTags, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 9 tools

    Disambiguation2/5

    The tool set contains overlapping functions, particularly create_api_doc and sync_swagger_to_confluence, which both handle Swagger/OpenAPI imports with unclear distinctions. Similarly, create_api_doc and create_api_doc_from_controller differ only by source but share the 'create' prefix, causing potential misselection. The generic page operations are distinct, but the API documentation tools blur boundaries.

    Naming Consistency3/5

    Most tools follow a verb_noun pattern (e.g., list_spaces, get_page, delete_page), but sync_swagger_to_confluence breaks this convention with an irregular long phrase. Additionally, create_api_doc and create_api_doc_from_controller inconsistently encode the source (one has a suffix, the other does not), reducing predictability.

    Tool Count4/5

    With 9 tools, the server is reasonably scoped for managing Confluence pages and API documentation. The count is not excessive, though some redundancy among Swagger/OpenAPI tools makes it feel slightly heavier than necessary.

    Completeness4/5

    The core CRUD operations for pages are covered (create, read, update, delete), along with search and space listing. API documentation generation supports multiple sources (Swagger, NestJS) and nested pages via sync. Missing minor features like version history or publishing workflows, but no critical gaps for the stated domain.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers