py-wiki-mcp
v1.0.39
Published
Minimal MCP server for creating Confluence pages and related tools
Downloads
49
Readme
py-wiki-mcp
Minimal MCP server written in TypeScript. This repository provides a set of Confluence-focused MCP tools and a small local MCP shim for development/testing.
Quick setup
- npm install
- npm run build
- npm start # runs the compiled server (or run the compiled file directly)
For fast iteration use the dev helpers (requires ts-node):
npm run dev-test # runs a small test client that lists available tools
npm run dev # runs the TS code directly (requires ts-node)Tools included
The tools live under src/tools/ and are exported by the tools barrel. Each tool exports a Zod schema and a Tool object.
create-confluence-page.ts— composite tool: creates a Confluence page and (optionally) uploads multiple attachments, then updates the page to embed/link them.confluence-create-page.ts— helper tool that creates a page (returns pageId).confluence-upload-attachment.ts— uploads a single file to a page (returns uploaded filename).confluence-build-content.ts— builds a Confluence storage-format body from inputs (returns storage string).confluence-update-page.ts— updates an existing page's storage body and increments the version.
Each tool expects a specific input object; schemas are exported from the tool files using Zod. See src/tools/*.ts for exact fields.
Example inputs (high level)
create-confluence-page
- baseUrl: string (e.g. https://your-domain.atlassian.net/wiki)
- userEmail: string
- apiToken: string
- spaceKey: string
- pageTitle: string
- files: string[] (optional local file paths)
confluence-create-page
- baseUrl, userEmail, apiToken, spaceKey, pageTitle
confluence-upload-attachment
- baseUrl, userEmail, apiToken, pageId, filePath
confluence-build-content
- title, body, macros (optional)
confluence-update-page
- baseUrl, userEmail, apiToken, pageId, storageBody, newTitle (optional)
Security & testing notes
- The tools use basic auth (email + API token) for Confluence REST API calls. Do not commit credentials. Use environment variables or a secret manager during testing.
- The Confluence API has rate limits and attachment size limits; avoid uploading very large files in automated tests.
- The dev test harness (
npm run dev-test) uses the local MCP shim and only lists registered tools; it does not call Confluence APIs by default.
How to run a quick integration test (manual)
- Build the project:
npm run build - Start the server:
npm start(ornode dist/index.js) - Use a small client script or Postman to call the MCP tool via the stdio transport (see test-client or write a simple shim call script). The repo includes
src/test-client.tsas an example to list and call tools.
Extras
- If you'd like, I can add example client scripts for each tool and small unit tests that mock
axiosto validate handler logic without hitting Confluence.
