plus4u-mcp
v0.1.7
Published
Plus4U MCP Server
Downloads
13
Readme
Plus4U MCP Server
A Model Context Protocol (MCP) server that provides document reading capabilities for Plus4U services with automatic authentication handling.
Features
- 📖 Document Reading: Read and convert bookkit documents to markdown format
- 🔐 Automatic Authentication: Handles Plus4U OIDC authentication automatically when needed
- 💾 Session Management: Keeps authentication token in memory until it expires
- 📡 MCP Compatible: Works with any MCP-compatible client (Claude Desktop, etc.)
- 🛠️ TypeScript: Written in TypeScript with full type safety
- 📦 CLI Tool: Can be used as a standalone command-line tool
Installation
From npx (recommended)
npx -y plus4u-mcpWith Cursor
{
"mcpServers": {
"plus4u-mcp": {
"command": "npx ",
"args": ["-y", "plus4u-mcp"],
"env": {
"endpointBaseUri": "http://localhost:8946/uu-aikit-maing01/22222222222222222222222222222222/"
}
}
}
}Environment Variables
endpointBaseUri: The base URI for Plus4U services (required) - should end with/LOG_LEVEL: Set logging level (error,warn,info,debug) - defaults toinfo
Available Tools
document_read
Read and convert a bookkit document (page) into markdown format. This tool automatically handles Plus4U authentication when needed and keeps the authentication token in memory until it expires.
Parameters:
uri(string): The bookkit URI to read and convert to markdown format (e.g., a bookkit page URL)
Returns: Document content in markdown format with metadata.
When to use: Use this tool when you need to read the actual content of a specific bookkit page or document and convert it to markdown format.
document_find
Find relevant document URIs by asking questions to an AI chat assistant. This tool uses the same AI chat backend as aichat_ask but returns only the source URIs from the response, making it useful for finding relevant documentation links. The tool automatically handles Plus4U authentication when needed.
Parameters:
query(string): The question or query to search for relevant documents (e.g., 'How to configure authentication?', 'examples of validation types')
Returns: A uriList array containing relevant document URIs that match the query.
When to use: Use this tool when you need to find relevant documentation links or pages related to a specific topic or question.
document_get_bml_images
Extract SVG elements from a bookkit document (page) and convert them to PNG images. This tool virtualizes the page, finds all SVG elements (including SVG data URIs), and returns them as high-quality PNG images. The tool automatically handles Plus4U authentication when needed.
Parameters:
uri(string): The bookkit URI to extract SVG images from (e.g., a bookkit page URL)
Returns: Array of SVG images converted to PNG format with metadata.
When to use: Use this tool when you need to extract and convert SVG diagrams or images from a bookkit page to PNG format.
document_read_attachment
Download and read file attachments from a bookkit document (page). This tool identifies file links on the page and downloads supported file types (images, text, JSON, XML, Excel files) into the context, omitting videos. The tool automatically handles Plus4U authentication when needed.
Parameters:
uri(string): The bookkit URI to read attachments from (e.g., a bookkit page URL)
Returns: Array of downloaded file attachments with content and metadata.
When to use: Use this tool when you need to download and access file attachments from a bookkit page. Supports images, text files, JSON, XML, Excel files, and other document formats, but excludes video files.
aichat_ask
Ask questions to an AI chat assistant that can provide information about various topics including configurations, authentication, system settings, troubleshooting, and general technical questions. This tool maintains conversation context and can provide detailed responses with examples and guidance.
Parameters:
query(string): The question or query to ask the AI assistant (e.g., 'How to configure authentication?', 'What are the best practices for error handling?', 'Explain how to set up system profiles')
Returns: AI assistant response with relevant information and guidance, formatted for easy reading.
When to use: Use this tool when you need to ask questions or get information about technical topics, configurations, or when you need explanations and guidance.
Authentication
All tools automatically handle Plus4U OIDC authentication when needed. The authentication process is idempotent and safe to call multiple times:
- Check if an authentication token is already valid
- If token is invalid/missing, initiate the Plus4U login flow (opens browser)
- Store the authentication token in memory for subsequent requests
- Automatically re-authenticate when the token expires
The login() method is designed to be called multiple times safely - if a valid token already exists, it will simply confirm authentication without performing a new login.
Development
Build
npm run buildThis compiles TypeScript to JavaScript in the build/ directory and makes the output executable.
Add to Cursor
{
"mcpServers": {
"plus4u-mcp": {
"command": "node",
"args": ["/path/to/build/index.js"],
"env": {
"endpointBaseUri": "http://localhost:8080/uu-aikit-maing01/22222222222222222222222222222222/"
}
}
}
}Adding New Tools
- Create your tool implementation in the appropriate service directory
- Register the tool in the corresponding
*-tools.tsfile - Export from the service's
index.ts - Update the main
index.tsto register the new tool - The tool will be automatically available via the MCP protocol
