AI Agent Integration (MCP)

Connect AI agents to your internal documentation using the docs-mcp-server with 34 tools and 5 resource types.

What is MCP?

The Model Context Protocol (MCP) is an open standard for connecting AI agents to external tools and data sources. Instead of building custom integrations for each AI model, MCP provides a unified interface that any compatible agent can use.

Riven AI ships a dedicated docs-mcp-server that exposes your internal documentation as MCP tools and resources. This means AI agents like Claude can search, read, create, and update documentation autonomously.

The docs-mcp-server is a read-write integration. Agents can create pages, add comments, update content, and manage labels — not just read.

docs-mcp-server

The docs-mcp-server exposes 34 tools and 5 resource types that cover the full surface area of the Internal Docs platform.

Transports

The server supports two transport modes:

TransportUse Case
stdioLocal agents like Claude Code. The server runs as a child process.
Streamable HTTPRemote agents and web-based integrations. Connects over HTTP.

Tool Categories

Spaces

ToolDescription
list_spacesList all spaces in the organization
create_spaceCreate a new documentation space
get_spaceGet space details by slug or ID

Pages (CRUD)

ToolDescription
get_pageRetrieve a page by ID with full content
create_pageCreate a new page in a space
update_pageUpdate page title, content, or metadata
delete_pageDelete a page (moves to trash)
ToolDescription
get_page_treeGet the full page hierarchy for a space
get_page_ancestorsGet all parent pages up to the root
get_page_descendantsGet all child pages recursively
ToolDescription
search_docsHybrid search across all documentation. Supports filters for space, page type, and labels.

Comments

ToolDescription
list_commentsList all comments on a page
add_commentAdd a footer or inline comment
resolve_commentResolve or reopen a comment thread
delete_commentDelete a comment

Labels

ToolDescription
list_labelsList labels on a page
add_labelAdd a label to a page
remove_labelRemove a label from a page

Templates

ToolDescription
list_templatesList all available templates
create_page_from_templateCreate a new page using a template

History

ToolDescription
get_page_historyGet version history for a page
get_page_diffDiff two versions of a page

Attachments

ToolDescription
list_attachmentsList file attachments on a page
upload_attachmentUpload a file attachment via presigned URL

Permissions

ToolDescription
get_permissionsGet space permissions
set_permissionGrant a user or role access to a space

Resource Types

In addition to tools, the server exposes 5 MCP resource types for direct data access:

ResourceURI PatternDescription
Spacedocs://spaces/{slug}Space metadata and settings
Pagedocs://pages/{id}Full page content and metadata
Page Treedocs://spaces/{slug}/treeHierarchical page structure
Labelsdocs://spaces/{slug}/labelsAll labels in a space
Search Resultsdocs://search?q={query}Search result set

Claude Code Setup

To connect Claude Code to your internal documentation, add the docs-mcp-server to your project or user settings.

Add to .claude/settings.json in your repository:

.claude/settings.json
json
{
  "mcpServers": {
    "riven-docs": {
      "command": "npx",
      "args": ["@riven-private/docs-mcp-server", "--transport", "stdio"],
      "env": {
        "RIVEN_TOKEN": "${RIVEN_TOKEN}",
        "RIVEN_ORG_ID": "your-org-id"
      }
    }
  }
}

The MCP server requires a valid Riven auth token. Run riven auth login first, or set the RIVEN_TOKEN environment variable for CI/headless environments.

Example Workflows

Create an ADR from Template

Ask your AI agent:

"Create an ADR in the Engineering space titled 'Migrate to PostgreSQL 17' using the ADR template. Set the status to Proposed and add me as a decider."

The agent will:

  1. Call list_templates to find the ADR template
  2. Call create_page_from_template with the ADR template, title, and space
  3. Call update_page to set status metadata and deciders

Search Docs and Summarize

"Search our internal docs for everything related to authentication flow and give me a summary."

The agent will:

  1. Call search_docs with query "authentication flow"
  2. Call get_page for each relevant result to read the full content
  3. Synthesize and summarize the findings

Review Recent Changes

"What documentation changed in the Platform space this week? Summarize the diffs."

The agent will:

  1. Call get_page_tree for the Platform space
  2. Call get_page_history for recently modified pages
  3. Call get_page_diff to compare versions
  4. Summarize the changes

Add Comments and Labels

"Review the 'Database Failover' runbook. Add inline comments where steps are unclear and label it as 'needs-update'."

The agent will:

  1. Call get_page to read the runbook content
  2. Call add_comment for each section that needs clarification
  3. Call add_label to tag the page with "needs-update"

Authentication

The docs-mcp-server uses the same JWT-based authentication as all Riven platform services. Tokens are scoped to an organization, so agents can only access documentation within the authenticated org.

For local development with Claude Code, the server automatically reads credentials from ~/.config/riven/credentials.json (created by riven auth login). For CI or remote agents, pass the token via the RIVEN_TOKEN environment variable.

Next Steps