@sophia-wiki/mcp
Uses optional Atlassian credentials to download Confluence attachments by URL during import, with basic auth restricted to the configured Atlassian origin.
Migrates Confluence content into Sophia: maps users, creates spaces and members, imports pages with version history, attachments, comments, deterministic IDs, and checks referenced files.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@sophia-wiki/mcp search the Engineering space for onboarding docs"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@sophia-wiki/mcp
MCP server for Sophia, the wiki. It lets your AI (Claude Code, Claude Desktop, Cursor or any MCP client) read, search and write pages, comment and upload files as you, through a personal API token. It can also migrate Confluence into Sophia with the full history of every page.
It runs locally over stdio (npx -y @sophia-wiki/mcp) and calls the Sophia REST API.
1. Create a token
In Sophia, open Conectar con IA in the sidebar (/connect-ai) and create a token (shown once, sph_…). Scopes:
Scope | Allows |
| spaces, tree, pages, versions, search, recent, comments, files, tickets |
| create, save, move, trash, restore pages |
| create, edit, delete comments |
| upload and remove files |
| all |
A token never does more than its owner can do in Sophia, and you can revoke it at any time.
import:write tokens expire in 30 or 90 days, and a password reset of the owner revokes them. To renew,
create a new one in Conectar con IA, put it in SOPHIA_TOKEN and restart the client. After many
invalid tokens from one IP, Sophia answers 429 to every token request from it for a while: wait and check the token.
Related MCP server: Confluence MCP Server
2. Configure your client
Variable | Value |
| URL of the Sophia API, e.g. |
| Your token, |
| Optional. Base of the web app for page links (default: the API URL without |
| Optional. Largest file |
| Optional, all three or none: to download Confluence attachments by URL (read only) |
Claude Code
claude mcp add sophia -e SOPHIA_API_URL=https://sophia.example.com/sophia/api -e SOPHIA_TOKEN=sph_... -- npx -y @sophia-wiki/mcpAdd -s user (before --) to have it in every project. On Windows use -- cmd /c npx -y @sophia-wiki/mcp.
Claude Desktop
Settings → Developer → Edit Config (claude_desktop_config.json):
{
"mcpServers": {
"sophia": {
"command": "npx",
"args": ["-y", "@sophia-wiki/mcp"],
"env": {
"SOPHIA_API_URL": "https://sophia.example.com/sophia/api",
"SOPHIA_TOKEN": "sph_..."
}
}
}
}Restart Claude Desktop afterwards. Cursor takes the same mcpServers block in ~/.cursor/mcp.json.
Tools
Spaces are identified by key (ENG), pages by uuid.
Tool | What it does | Scope |
| The person the token acts as | any |
| Spaces you can see, your role, members |
|
| The page tree of a space (or a subtree) |
|
| Markdown body, version, URL; an older version; history; long bodies in slices |
|
| Search titles and text |
|
| Pages updated last |
|
| New page at the root or under a parent |
|
| New version; needs the version you read, a 409 explains how to re-read and merge |
|
| Threads; comment or reply |
|
| Files of a page, with the token to show each |
|
| Local file onto a page; returns |
|
| Deterministic Sophia ids from Confluence ids (no API call) | none |
| Find or create people (no mail, no password) |
|
| Space and members |
|
| A page with all its versions |
|
| Append later versions |
|
| A file from a local path or a URL |
|
| A comment with its author and dates |
|
| Confluence id → Sophia id |
|
| Referenced files that are not ready |
|
Read tools are marked readOnlyHint; write tools destructiveHint: false. No tool deletes anything.
Answers are short, one line per item, and cut at 20,000 characters (a page body is read in slices of
max_chars, and the answer says when it is cut so a partial body is never saved).
Sophia Markdown
Bodies are GitHub-flavoured Markdown. Raw HTML is not rendered. The extras:
Files:
. Comments cannot carry files.Mentions:
@[Name](user:<uuid>)(Sophia user ids).Panels: a blockquote whose first line is
> [!INFO],> [!NOTE],> [!SUCCESS],> [!WARNING]or> [!ERROR].Internal links:
[Title](/sophia/spaces/<KEY>/pages/<pageId>).Ticket keys such as
PROJ-12, written as plain text (not in code or links), link to Kanbio automatically.Links may point to
http(s),mailto,/site-pathsand#anchors; images toattachment:orhttp(s).
Migrating Confluence
The AI reads Confluence with Atlassian's own MCP, converts each page version to Sophia Markdown itself,
and writes it here. The import_* tools need an import:write token owned by a global admin; they send
no mail, no notifications and no per-row audit events.
import_find_users/import_ensure_user: map people (usedeactivated: truefor people who left).import_create_space, thenimport_add_member.import_idsgives deterministic ids (UUIDv5 ofconfluence_page:<id>orconfluence_attachment:<id>), so you can write[Title](/sophia/spaces/<KEY>/pages/<uuid>)andin a body before the target exists, and a retry produces the same ids.import_pageper page (parents first;parent_page_idtakes a Sophia id or an imported Confluence id), withversionsoldest first; the last one is the current text. Histories over 500 versions (or ~20 MB) are split into requests automatically.import_attachmentper file (local path, or a URL: for URLs onATLASSIAN_SITE_URLit signs in with basic auth, and those credentials are never sent to any other host, redirects included). The file is streamed to a temporary file, checked against the size cap, then reserved, uploaded to storage and completed.import_comment, thenimport_check_pageto list files a page references that are not ready.
Import writes (members, pages, versions, files, comments) only work in spaces created with
import_create_space; any other space answers 403 IMPORT_SPACE_NOT_IMPORTED. The /import/* routes
accept tokens only, never a web session. Dates may not be more than 10 minutes in the future, and a page
cannot be created after its first version.
Everything is idempotent by Confluence id: run it again and nothing is duplicated. Comment replies are flattened to one level by the API.
Errors
API errors come back as plain sentences the AI can act on: a missing scope (403) names it and says not to retry, a version conflict (409) says to re-read, merge and save again, a rejected body says why (link scheme, missing file, unknown mention), an unknown file type lists the allowed ones, an expired or revoked token (401) says how to create a new one, and 429 asks to wait a minute.
Security
The token acts as you, limited to its scopes. Start with
pages:read; giveimport:writeonly for a migration.Page text is data written by people: an AI may be tricked by it (prompt injection). Let your client confirm write tools.
upload_attachmentandimport_attachmentread local files and download URLs: check the paths and URLs your client shows.The Atlassian credentials only go to the origin of
ATLASSIAN_SITE_URL. The Sophia token only goes toSOPHIA_API_URL. Neither is logged.
Development
npm install
npm run build # dist/index.js
npm test # build + node:test (fake API, local HTTP servers)
SOPHIA_API_URL=http://localhost:4100/api SOPHIA_TOKEN=sph_... npm run inspectRequires Node.js 20 or newer.
Releasing
Releases go to npm from GitHub Actions with trusted publishing (OIDC, no npm token): bump version
(npm version <x.y.z> --no-git-tag-version), commit, tag v<x.y.z> and push the tag;
.github/workflows/publish.yml builds, tests and runs npm stage publish, and a maintainer approves it
with 2FA. The very first version is published by hand (npm publish --access public), and then the
trusted publisher is configured on npmjs.com.
Available Tools
23 toolsadd_commentComment on a pageA
Add a comment to a page, or reply to one with parent_comment_id (reply to the first comment of a thread). Markdown, mentions @[Name](user:<uuid>) and ticket keys work; comments cannot carry files.
Inputs: body (required), page_id (required), parent_comment_id.
create_pageCreate a pageA
Create a page in a space (needs editor role there), at the root or under a parent page. Returns its id, version 1 and URL. To add files, create the page first, then upload_attachment and update_page. Body = GitHub-flavoured Markdown (tables, task lists, fenced code). Raw HTML is NOT rendered (shown as text), so convert it. Sophia syntax: files ; mentions @[Name](user:<uuid>); panels = blockquote whose first line is > [!INFO], > [!NOTE], > [!SUCCESS], > [!WARNING] or > [!ERROR]; internal links [Title](/sophia/spaces/<KEY>/pages/<pageId>); Kanbio ticket keys written as plain text (e.g. PROJ-12; not inside code or links) link automatically. Links may only point to http(s), mailto, /site-paths or #anchors; images only to attachment: or http(s).
Inputs: title (required), space_key (required), body, parent_page_id.
get_pageGet a pageARead-only
Read a page: title, version, URL, breadcrumbs and the body as Sophia Markdown (exact text, to edit and send back with update_page). Long bodies are cut at max_chars: continue with offset, and never save a cut body. With version, reads that older version; with history, lists all versions. Body = GitHub-flavoured Markdown (tables, task lists, fenced code). Raw HTML is NOT rendered (shown as text), so convert it. Sophia syntax: files ; mentions @[Name](user:<uuid>); panels = blockquote whose first line is > [!INFO], > [!NOTE], > [!SUCCESS], > [!WARNING] or > [!ERROR]; internal links [Title](/sophia/spaces/<KEY>/pages/<pageId>); Kanbio ticket keys written as plain text (e.g. PROJ-12; not inside code or links) link automatically. Links may only point to http(s), mailto, /site-paths or #anchors; images only to attachment: or http(s).
Inputs: page_id (required), offset, history, version, +1 more.
get_page_treeGet the page tree of a spaceARead-only
The live page tree of a space as an indented list of "title (page id)", in sidebar order. Pass root_page_id to see only one subtree. Use the ids with get_page.
Inputs: space_key (required), root_page_id.
import_add_memberAdd a space member (import)AIdempotent
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Only works in a space created with import_create_space (otherwise 403 IMPORT_SPACE_NOT_IMPORTED). Add a person to a space with a role (viewer < editor < admin). If they are already a member their role is NOT changed (created=false).
Inputs: role (required), user_id (required), space_key (required).
import_attachmentImport a file onto a page (import)AIdempotent
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Only works in a space created with import_create_space (otherwise 403 IMPORT_SPACE_NOT_IMPORTED). Upload a file to an imported page under the uuid you chose (the one written in the body as ; by default derived from source_id, see import_ids). Give exactly one source: path (a local file) or url (downloaded to a temporary file with a size cap; for URLs on ATLASSIAN_SITE_URL it signs in with ATLASSIAN_EMAIL + ATLASSIAN_API_TOKEN, and those credentials are never sent to any other host, redirects included). Idempotent by source_id. Run import_check_page afterwards to find files that are still missing. The server decides the accepted types and says so when it refuses one.
Inputs: page_id (required), source_id (required), created_at (required), uploaded_by_user_id (required), +5 more.
import_check_pageCheck the files of an imported page (import)ARead-only
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Lists the files a page body references that are not ready (never uploaded, or still pending). Run it after importing the attachments of a page: an empty list means every  has its file.
Inputs: page_id (required).
import_commentImport a comment (import)AIdempotent
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Only works in a space created with import_create_space (otherwise 403 IMPORT_SPACE_NOT_IMPORTED). Create a comment on an imported page with its original author and dates. Idempotent by source_id. Replies use parent_comment_id = the Sophia id, or the Confluence id, of a comment you imported before; the API flattens threads to ONE level: a reply to a reply attaches to the first comment of the thread. Comments cannot carry files. Markdown rules are the same as pages (mentions, ticket keys, links); raw HTML is not rendered.
Inputs: body (required), page_id (required), source_id (required), created_at (required), +3 more.
import_create_spaceCreate a space (import)AIdempotent
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Create a space from a Confluence space. Idempotent by source_id: if it was imported before it returns that space (created=false) and changes nothing. The key must be 2–50 characters, uppercase letter first, then uppercase letters or digits (Confluence keys may need adjusting). Add its people afterwards with import_add_member.
Inputs: key (required), name (required), source_id (required), created_by_user_id (required), +2 more.
import_ensure_userCreate or get a Sophia user (import)AIdempotent
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Make sure a person exists, by email. No password and no mail is created: an imported person later signs in with SSO (linked by verified email) or, in local mode, with "forgot password". If the email already exists it returns that person WITHOUT changing them. Use deactivated=true for people who left the company but authored content.
Inputs: email (required), last_name (required), first_name (required), deactivated, +1 more.
import_find_usersFind Sophia users (import)ARead-only
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Search people by name or email, including deactivated ones. Returns "Sophia user id · name · email". Sophia user ids are what the other import tools take as authors and what mentions use: @[Name](user:<uuid>). If nobody matches, create the person with import_ensure_user.
Inputs: limit, search.
import_idsCompute deterministic import idsARead-only
Pure computation, no API call. Derives the Sophia ids an import will use (UUIDv5 of "confluence_page:" etc. in a fixed namespace), so you can write internal links [Title](/sophia/spaces/<KEY>/pages/<uuid>) and file tokens  in a body BEFORE the page or file is imported, and retries get the same ids. import_page and import_attachment use these ids by default. Spaces keep their own key; ids for confluence_space/confluence_comment are given too.
Inputs: source_ids (required), type, file_name, space_key.
import_lookupLook up imported objects (import)ARead-only
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Map Confluence ids to Sophia ids (up to 200 per call). For pages it gives the Sophia page id to build internal links: [Title](/sophia/spaces/<KEY>/pages/<pageId>) (KEY = the key of the space where that page was imported). Source ids that were not imported are listed apart. Also tells whether something was already imported, to resume an interrupted migration.
Inputs: source_ids (required), type.
import_pageImport a page with its history (import)AIdempotent
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Only works in a space created with import_create_space (otherwise 403 IMPORT_SPACE_NOT_IMPORTED). Create a page with its WHOLE history. versions go in chronological order (oldest first): the last one is the current text, the earlier ones become history. Idempotent by source_id (created=false, nothing changes). The page id is deterministic (see import_ids), so you can write internal links to ANY page, imported or not, in one pass: /sophia/spaces/<KEY>/pages/<id from import_ids>. Same for files: write  and upload later with import_attachment. A 409 IMPORT_ID_TAKEN means the id belongs to something not imported from this source. Parents must exist first (import parents before children). position orders siblings. More than 500 versions (or over ~20 MB of text) are split automatically: the first request creates the page and the rest are appended in order. If a later request fails, the error says how many versions got in: continue with import_page_versions. parent_page_id takes a Sophia id or an already imported Confluence id. Body = GitHub-flavoured Markdown (tables, task lists, fenced code). Raw HTML is NOT rendered (shown as text), so convert it. Sophia syntax: files ; mentions @[Name](user:<uuid>); panels = blockquote whose first line is > [!INFO], > [!NOTE], > [!SUCCESS], > [!WARNING] or > [!ERROR]; internal links [Title](/sophia/spaces/<KEY>/pages/<pageId>); Kanbio ticket keys written as plain text (e.g. PROJ-12; not inside code or links) link automatically. Links may only point to http(s), mailto, /site-paths or #anchors; images only to attachment: or http(s).
Inputs: versions (required), source_id (required), space_key (required), created_at (required), +5 more.
import_page_versionsAdd later versions to an imported page (import)A
Needs a token with the import:write scope whose owner is a global admin. Nothing is emailed or notified, and no per-row audit events are written. Only works in a space created with import_create_space (otherwise 403 IMPORT_SPACE_NOT_IMPORTED). Append versions (oldest first) after the page's current one, for a second pass, a long history sent in batches, or a final version with corrected links. They must be newer than what the page already has. The last one becomes the current text. Batches above 500 versions or ~20 MB are split automatically. Not idempotent: do not resend a batch that succeeded. Body = GitHub-flavoured Markdown (tables, task lists, fenced code). Raw HTML is NOT rendered (shown as text), so convert it. Sophia syntax: files ; mentions @[Name](user:<uuid>); panels = blockquote whose first line is > [!INFO], > [!NOTE], > [!SUCCESS], > [!WARNING] or > [!ERROR]; internal links [Title](/sophia/spaces/<KEY>/pages/<pageId>); Kanbio ticket keys written as plain text (e.g. PROJ-12; not inside code or links) link automatically. Links may only point to http(s), mailto, /site-paths or #anchors; images only to attachment: or http(s).
Inputs: page_id (required), versions (required).
list_attachmentsList files of a pageBRead-only
The ready files of a page: name · type · size · the token  that shows the file in a body.
Inputs: page_id (required).
list_commentsList comments of a pageARead-only
The comments of a page as threads (oldest first, replies indented). Each line: date, comment id, author and text; deleted ones that still hold replies show as "(deleted comment)".
Inputs: page_id (required).
list_spacesList spacesARead-only
List the spaces you can see, with their key (used by the other tools), your role in each (viewer < editor < admin) and member count. Archived spaces are read-only and only listed when asked.
Inputs: search, archived.
recent_pagesRecently updated pagesBRead-only
The pages updated last, across the spaces you can see: title · space · page id · updated.
Inputs: limit.
search_pagesSearch pagesARead-only
Search page titles and text (prefix match) in the spaces you can see, newest first. One line per hit: title · space · page id · updated · plain-text snippet. Use get_page for the whole page.
Inputs: query (required), limit, space_key.
update_pageUpdate a pageA
Save a new version of a page (needs editor role). Always read the page first (get_page) and send the version you read: if someone saved in between, Sophia answers 409 and you must re-read, merge their changes with yours and save again with the new version. Send the COMPLETE new body (it replaces the old one); title and body are each optional, the one you omit stays as it is. Body = GitHub-flavoured Markdown (tables, task lists, fenced code). Raw HTML is NOT rendered (shown as text), so convert it. Sophia syntax: files ; mentions @[Name](user:<uuid>); panels = blockquote whose first line is > [!INFO], > [!NOTE], > [!SUCCESS], > [!WARNING] or > [!ERROR]; internal links [Title](/sophia/spaces/<KEY>/pages/<pageId>); Kanbio ticket keys written as plain text (e.g. PROJ-12; not inside code or links) link automatically. Links may only point to http(s), mailto, /site-paths or #anchors; images only to attachment: or http(s).
Inputs: page_id (required), version (required), body, title.
upload_attachmentUpload a file to a pageA
Upload a local file (absolute path on the machine running this server) to a page you can edit. Returns the token : paste it where the file should show in the body, then save with update_page. The server decides which file types and sizes it takes and says so when it refuses one.
Inputs: path (required), page_id (required).
whoamiWho am IARead-only
Show the person this token acts as (name, email, global role). Use it to check the connection; every write is made as this person and limited by their role.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 23 tools
The surface splits into two clearly labeled clusters: core wiki tools and import_-prefixed Confluence migration tools. Within each cluster tools target distinct resources (pages, comments, attachments, spaces, users), though a few pairs (create_page vs import_page, list_attachments vs import_check_page, import_ids vs import_lookup) require reading the long descriptions to see the boundary.
Core tools are mostly verb_noun (list_spaces, create_page, update_page, add_comment, upload_attachment), and the import suite is uniformly import_<action>. Minor deviations exist (recent_pages is adjective-first, whoami is verb-only, get_page_tree uses a compound noun), but the pattern remains readable.
23 tools is on the heavy side for a wiki server, and the set is effectively two suites glued together. Each cluster (12 core + 11 import) is individually well-scoped, but the combined surface sits at the borderline where an agent must scan a lot of tools.
Page read/create/update, comments, attachments and search are covered, and the import lifecycle is thorough. However, no delete operations exist anywhere (page, comment, attachment), comments cannot be edited or resolved, and there is no ordinary space-creation path outside the import flow—notable gaps for a wiki surface.
Maintenance
Related MCP Connectors
Search and read spaces, pages and comments; create and update pages, add comments in Confluence.
1Connect to Atlassian Jira, Confluence, Loom, and more to search, create, and manage your work.
Unofficial Confluence MCP — wraps the Confluence Cloud REST API v2 (OAuth)
Connect to your MediaWiki using simple credentials and manage content without OAuth. Search, read,…
Related MCP Servers
- FlicenseAqualityFmaintenanceEnables AI assistants to interact with Confluence Cloud for managing spaces, pages, and content via the Model Context Protocol (MCP).1115-
- AlicenseAqualityDmaintenanceEnables AI assistants to interact with Atlassian Confluence Cloud by providing tools to create, update, search, and delete pages. It facilitates seamless content management within Confluence spaces using Markdown and the Confluence REST API.6MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to read Confluence Cloud pages as markdown, browse page trees, download image attachments, and diff content against local documentation.MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, retrieve, and manage Confluence pages, and generate weekly status drafts from Jira activity.1-