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:
| Transport | Use Case |
|---|---|
| stdio | Local agents like Claude Code. The server runs as a child process. |
| Streamable HTTP | Remote agents and web-based integrations. Connects over HTTP. |
Tool Categories
Spaces
| Tool | Description |
|---|---|
list_spaces | List all spaces in the organization |
create_space | Create a new documentation space |
get_space | Get space details by slug or ID |
Pages (CRUD)
| Tool | Description |
|---|---|
get_page | Retrieve a page by ID with full content |
create_page | Create a new page in a space |
update_page | Update page title, content, or metadata |
delete_page | Delete a page (moves to trash) |
Navigation
| Tool | Description |
|---|---|
get_page_tree | Get the full page hierarchy for a space |
get_page_ancestors | Get all parent pages up to the root |
get_page_descendants | Get all child pages recursively |
Search
| Tool | Description |
|---|---|
search_docs | Hybrid search across all documentation. Supports filters for space, page type, and labels. |
Comments
| Tool | Description |
|---|---|
list_comments | List all comments on a page |
add_comment | Add a footer or inline comment |
resolve_comment | Resolve or reopen a comment thread |
delete_comment | Delete a comment |
Labels
| Tool | Description |
|---|---|
list_labels | List labels on a page |
add_label | Add a label to a page |
remove_label | Remove a label from a page |
Templates
| Tool | Description |
|---|---|
list_templates | List all available templates |
create_page_from_template | Create a new page using a template |
History
| Tool | Description |
|---|---|
get_page_history | Get version history for a page |
get_page_diff | Diff two versions of a page |
Attachments
| Tool | Description |
|---|---|
list_attachments | List file attachments on a page |
upload_attachment | Upload a file attachment via presigned URL |
Permissions
| Tool | Description |
|---|---|
get_permissions | Get space permissions |
set_permission | Grant 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:
| Resource | URI Pattern | Description |
|---|---|---|
| Space | docs://spaces/{slug} | Space metadata and settings |
| Page | docs://pages/{id} | Full page content and metadata |
| Page Tree | docs://spaces/{slug}/tree | Hierarchical page structure |
| Labels | docs://spaces/{slug}/labels | All labels in a space |
| Search Results | docs://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:
{
"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:
- Call
list_templatesto find the ADR template - Call
create_page_from_templatewith the ADR template, title, and space - Call
update_pageto 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:
- Call
search_docswith query "authentication flow" - Call
get_pagefor each relevant result to read the full content - Synthesize and summarize the findings
Review Recent Changes
"What documentation changed in the Platform space this week? Summarize the diffs."
The agent will:
- Call
get_page_treefor the Platform space - Call
get_page_historyfor recently modified pages - Call
get_page_diffto compare versions - 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:
- Call
get_pageto read the runbook content - Call
add_commentfor each section that needs clarification - Call
add_labelto 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
- Internal Docs Overview — Architecture and capabilities of the docs platform.
- Spaces, Pages & Content Types — Deep dive into the page type system.
- CLI Reference — Full CLI command reference for documentation management.