olafkfreund/mcp-internal-wiki
If you are the rightful owner of mcp-internal-wiki and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
MCP Internal Wiki Server is a bridge between company knowledge bases and development environments, using the Model Context Protocol (MCP) for seamless documentation access.
transform_content
Transform wiki content or markdown into executable code in any programming language.
generate_code
Generate code from wiki content using templates and AI-powered generation.
generate_project
Generate complete project structures from wiki documentation.
๐ MCP Internal Wiki Server
๐ What is MCP Wiki Server?
MCP Internal Wiki Server is a specialized bridge between your company's knowledge bases and your development environment. Using the Model Context Protocol (MCP), it enables seamless access to documentation right where you need it - in your editor.
๐ก MCP (Model Context Protocol) is an open standard for integrating contextual information into AI-assisted development environments.
โจ Why Use MCP Wiki Server?
๐ Boost Productivity
- Instant knowledge access: No more context switching between your IDE and browser
- Consistent information: Every team member accesses the same up-to-date documentation
- Reduced onboarding time: New developers can find information directly in their workflow
๐ How It Works
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
โ โ โ โ โ โ
โ Your Wiki โโโโโโโค MCP Server โโโโโโโค VS Code โ
โ Sources โ โ โ โ Extension โ
โ โ โ โ โ โ
โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโ
^ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Query & Response Flow
๐ฏ Key Features
- ๐ Multi-source integration: Connect to multiple wiki platforms simultaneously
- ๐ Contextual search: Find exactly what you need with advanced query capabilities
- ๐ Code transformation: Convert wiki content to executable code in multiple languages
- ๐๏ธ Project generation: Generate complete project structures from documentation
- ๐จ Template system: Use Handlebars templates for consistent code generation
- ๐ค AI-powered: Leverage AI providers for intelligent code generation and transformation
- ๐งฉ Extensible architecture: Add custom sources and adapters for your specific needs
- ๐ ๏ธ Platform agnostic: Works with any MCP-compatible editor
- ๐ Privacy-focused: All content remains within your environment; no external API calls
- ๐ Secure authentication: Support for basic, token, and custom authentication methods for private wikis
- โก Lightning fast: Advanced performance optimization with multi-level caching, connection pooling, and batch processing
- ๐ Enterprise scale: Handles millions of wiki pages with intelligent resource management and real-time monitoring
- ๐ Performance monitoring: Real-time metrics collection with cache hit rates, response times, and throughput tracking
๐ฆ Quick Start
# Install globally
npm install -g mcp-internal-wiki
# Run the server
mcp-wiki-server
๐ง Setup & Configuration
1. Installation
Choose your preferred installation method:
๐ฅ Local Installation
# Clone the repository
git clone https://github.com/yourusername/mcp-internal-wiki.git
cd mcp-internal-wiki
# Install dependencies
npm install
# Build the project
npm run build
๐ Global Installation
# Install globally
npm install -g mcp-internal-wiki
# Run the server
mcp-wiki-server
โก Quick Install (no installation)
npx mcp-internal-wiki
โ๏ธ NixOS Installation
# Install via the flake
nix profile install github:yourusername/mcp-internal-wiki
# Or run without installing
nix run github:yourusername/mcp-internal-wiki
See the for more details.
2. Configure Wiki Sources
Create or edit mcp.config.json
to include your wiki URLs:
{
"wikiUrls": [
"https://your-company-wiki.example.com",
"https://your-team-gitbook.example.io",
"https://private-confluence.example.com/wiki"
],
"cacheTimeoutMinutes": 30
}
3. Configure Authentication for Private Wikis
For wikis that require authentication, add an auth
section to your mcp.config.json
:
{
"wikiUrls": [
"https://your-company-wiki.example.com",
"https://your-team-gitbook.example.io",
"https://private-confluence.example.com/wiki"
],
"cacheTimeoutMinutes": 30,
"auth": [
{
"urlPattern": "example\\.confluence\\.com",
"type": "basic",
"username": "username",
"password": "password",
"comment": "Replace with actual credentials for your Confluence instance"
},
{
"urlPattern": "example\\.sharepoint\\.com",
"type": "token",
"token": "your-access-token",
"comment": "Replace with actual token for your SharePoint instance"
},
{
"urlPattern": "api\\.github\\.com",
"type": "custom",
"headerName": "Authorization",
"headerValue": "token ghp_yourgithubpersonalaccesstoken",
"comment": "For accessing private GitHub repositories"
}
]
}
Supported authentication types:
basic
: Username and password for HTTP Basic Authtoken
: Bearer token authenticationcustom
: Custom header authenticationoauth
: OAuth 2.0 authentication (advanced configuration)
4. VS Code Integration
To use the MCP Internal Wiki Server with VS Code:
- Install the Copilot MCP Extension: Marketplace Link
- Configure the MCP server:
- Create
.vscode/mcp.json
in your workspace root:
- Create
{
"servers": {
"my-mcp-wiki-server": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/server.js"],
"env": {
"MCP_CONFIG_PATH": "${workspaceFolder}/mcp.config.json"
}
}
}
}
- For global install, use
"command": "mcp-wiki-server"
. - For npx, use
"command": "npx", "args": ["mcp-internal-wiki"]
.
- Restart VS Code to apply the configuration.
- Test integration:
- Open a markdown file and type a query related to your wiki content.
- The MCP extension should provide completions or context from your wiki sources.
- Troubleshooting:
- Check the VS Code Output panel (MCP channel) for logs.
- Ensure the MCP server is running and
mcp.config.json
is valid. - See
TESTING_VS_CODE.md
andVSCODE_QUICK_REFERENCE.md
for more help.
VS Code Integration and Testing
Setup
- Install the Copilot MCP Extension from the VS Code Marketplace.
- Create
.vscode/mcp.json
in your workspace root:
{
"servers": {
"my-mcp-wiki-server": {
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}/dist/server.js"],
"env": {
"MCP_CONFIG_PATH": "${workspaceFolder}/mcp.config.json"
}
}
}
}
- For global install, use
"command": "mcp-wiki-server"
. - For npx, use
"command": "npx", "args": ["mcp-internal-wiki"]
.
- Restart VS Code to apply the configuration.
Testing
- Open a markdown file and type a query related to your wiki content.
- The MCP extension should provide completions or context from your wiki sources.
- Run
npm run test:simple
ornpm run test:interactive
for CLI validation.
Troubleshooting
- Check the VS Code Output panel (MCP channel) for logs.
- Ensure the MCP server is running and
mcp.config.json
is valid. - See
TESTING_VS_CODE.md
andVSCODE_QUICK_REFERENCE.md
for more help.
๐ Content Transformation & Code Generation
MCP Internal Wiki Server includes powerful transformation capabilities that can convert your wiki documentation into executable code and complete project structures.
Available MCP Tools
The server provides these transformation tools through the standard MCP protocol:
๐ transform_content
Transform wiki content or markdown into executable code in any programming language.
Usage in VS Code:
- Select wiki content in your editor
- Access via MCP tools interface
- Choose target language and framework
Parameters:
content
: Wiki content or markdown to transformtargetLanguage
: Target programming language (typescript, python, javascript, etc.)framework
: Optional framework (express, fastapi, react, etc.)projectType
: Optional project type (api, library, cli, etc.)
๐๏ธ generate_code
Generate code from wiki content using templates and AI-powered generation.
Parameters:
content
: Wiki documentation to generate code fromcodeType
: Type of code to generate (dockerfile, typescript, python, yaml, etc.)templateName
: Optional template to use (express-server, typescript-class, etc.)
Features:
- Template-based generation: Uses Handlebars templates for consistent output
- AI-enhanced: Leverages configured AI providers for intelligent code generation
- Multi-format support: Generates Dockerfiles, package.json, TypeScript classes, and more
๐ generate_project
Generate complete project structures from wiki documentation.
Parameters:
content
: Wiki content describing project requirementsprojectType
: Type of project (express-api, react-app, cli-tool, etc.)language
: Programming language (typescript, python, javascript, etc.)
Capabilities:
- Full project scaffolding: Creates complete directory structures
- Multi-file generation: Generates all necessary project files
- Best practices: Follows established patterns and conventions
Template System
The transformation system uses Handlebars templates for consistent code generation:
Available Templates:
typescript-class.hbs
- TypeScript class definitionsexpress-server.hbs
- Express.js server setupdockerfile.hbs
- Docker containerizationpackage-json.hbs
- Node.js package configurationreadme.hbs
- Project documentation
Custom Templates:
Add your own templates in the /templates
directory using Handlebars syntax.
AI Integration
The transformation system integrates with multiple AI providers:
- OpenAI GPT-4o: Advanced code generation and analysis
- Google Gemini 2.5 Pro: Intelligent content transformation
- Azure OpenAI: Enterprise-grade AI capabilities
- Claude: Anthropic's AI for precise code generation
Configuration in mcp.config.json
:
{
"ai": {
"enabled": true,
"providers": {
"openai": {
"apiKey": "your-openai-api-key",
"model": "gpt-4o"
},
"gemini": {
"apiKey": "your-gemini-api-key",
"model": "gemini-2.5-pro"
}
},
"primaryProvider": "openai"
}
}
Example Transformation Workflows
1. API Documentation โ Express Server
# User Authentication API
Create a REST API with JWT authentication
- POST /auth/login
- POST /auth/register
- GET /auth/profile
โ transform_content with targetLanguage: "typescript"
and framework: "express"
// Generated Express.js server with JWT authentication
import express from 'express';
import jwt from 'jsonwebtoken';
// ... complete implementation
2. Deployment Guide โ Docker Configuration
# Deployment Requirements
- Node.js 18 runtime
- PostgreSQL database
- Redis for caching
- Environment variables for config
โ generate_code with codeType: "dockerfile"
FROM node:18-alpine
RUN apk add --no-cache postgresql-client redis
# ... complete Docker configuration
3. Project Specification โ Full Scaffolding
# CLI Tool Requirements
TypeScript-based command-line tool for file processing
- File input/output operations
- Configuration via CLI arguments
- Unit testing with Jest
โ generate_project with projectType: "cli-tool"
and language: "typescript"
project/
โโโ src/
โ โโโ cli.ts
โ โโโ processor.ts
โ โโโ config.ts
โโโ tests/
โโโ package.json
โโโ tsconfig.json
โโโ README.md
Testing Transformation Features
Test the transformation capabilities:
# Run transformation tests
npm run test:transform
# Test individual transformation methods
node tests/test-mcp-tools.js
๐งฉ Agent Architecture
MCP Internal Wiki Server now uses a modular agent-based architecture for all core features:
- WikiContentAgent: Fetches and filters wiki content for queries
- AIRelevanceAgent: Scores content relevance using AI providers
- WikiIndexAgent: Manages (re)building the wiki search index
How to Use Agents
- Use the agent manager in
src/agents/index.ts
to access and orchestrate agents - Run agent-based tests with
just agent-test
or via the Nix shell - Agent endpoints are available in the Docker POC for integration testing
See for full agent usage and development guidelines.
๐๏ธ Use Cases
- Developer Documentation: Instant access to API references, code standards, and patterns
- Onboarding: Help new team members find information without leaving their IDE
- Knowledge Management: Create a unified interface to distributed knowledge bases
- DevOps Practices: Quick reference to infrastructure patterns and operational procedures
โก Performance & Scalability
Enterprise-Grade Performance Optimization
MCP Wiki Server includes advanced performance optimization features for handling large-scale deployments:
-
๐ Multi-Level Caching: Intelligent cache management with automatic allocation:
- Content cache (60% of memory) for large wiki pages
- Metadata cache (30% of memory) for page information
- Query cache (10% of memory) for search results
- LRU eviction with configurable size and item limits
-
๐ Full-Text Search Indexing: Real-time search capabilities:
- Background index rebuilding with minimal performance impact
- Fuzzy search matching for typos and partial queries
- Memory-optimized inverted index structure
- Configurable indexing intervals
-
โก Priority-Based Batch Processing: Background job management:
- Configurable concurrency limits for optimal resource usage
- Automatic retry mechanisms with exponential backoff
- Priority queues for critical vs. background tasks
- Job deduplication to prevent redundant processing
-
๐ HTTP Connection Pool: Efficient network resource management:
- Connection reuse to reduce overhead
- Automatic failover and health monitoring
- Configurable pool sizes and timeouts
- Resource cleanup and garbage collection
-
๐ Real-Time Performance Monitoring: Comprehensive metrics collection:
- Cache hit rates and memory usage tracking
- Response time monitoring with slow query detection
- Request throughput and error rate tracking
- Performance dashboards and alerting
Performance Testing
Run comprehensive performance tests to validate your deployment:
# Test cache performance (immediate - no build required)
npm run test:cache
# Full performance test suite (requires build)
npm run build && npm run test:performance
# Load testing with concurrent users
npm run test:load
# Performance CLI tools
npm run perf benchmark
npm run perf monitor
Configuration for Large Deployments
Configure performance settings in your mcp.config.json
:
{
"performance": {
"cache": {
"maxSize": 500, // 500MB cache size
"ttl": 3600000, // 1 hour TTL
"maxItems": 50000, // 50k items max
"enablePersistence": true
},
"indexing": {
"enabled": true,
"rebuildInterval": 300000, // 5 minutes
"backgroundSync": true
},
"batch": {
"batchSize": 20,
"concurrency": 10,
"maxRetries": 3
},
"pool": {
"maxConnections": 50,
"acquireTimeout": 10000,
"idleTimeout": 60000
}
}
}
Scaling Guidelines
Scale | Pages | Users | Cache Size | Expected Performance |
---|---|---|---|---|
Small | < 10K | < 10 | 100MB | > 50 RPS |
Medium | < 100K | < 50 | 500MB | > 100 RPS |
Large | < 1M | < 200 | 2GB | > 200 RPS |
Enterprise | > 1M | > 500 | 8GB | > 500 RPS |
๐งช Testing
Standard Testing Commands
Node.js Testing
# Build the project
npm run build
# or
just build
# Run a simple test
npm run test:simple
# or
just test-simple
# Run an interactive test client
npm run test:interactive
# or
just test-interactive
# Run a query test
npm run test:query
# or
just test-query
# Run all tests
npm run test:all
# or
just test-all
Nix Testing
# Simple test with Nix
nix run .#test
# or
just nix-test
# Interactive test with Nix
nix run .#interactive
# or
just nix-test-interactive
# Build with Nix
nix build
# or
just nix-build
๐ณ Docker Testing (POC Private Wiki)
The project includes a comprehensive Docker-based POC for testing private wiki authentication:
Docker POC Commands
# Build POC Docker images (includes TypeScript compilation)
just docker-poc-build
# Build POC Docker images without cache (for fresh builds)
just docker-poc-build-no-cache
# Start POC containers (markdown server + MCP server)
just docker-poc-up
# Stop POC containers
just docker-poc-down
# Run comprehensive POC test suite
just docker-poc-test
# Individual POC tests
just test-auth-poc # Basic authentication tests
just test-auth-integration # Integration authentication tests
just test-poc-interactive # Interactive test client
just test-poc-monitor # Container health monitoring
just test-poc-menu # Interactive test menu
What the Docker POC demonstrates:
- โ Private Wiki Authentication: MCP server connecting to password-protected wikis
- โ Containerized Deployment: Both services running in Docker containers with health checks
- โ Authentication Methods: Basic auth, token auth, and custom header authentication
- โ Integration Testing: Comprehensive test suite validating all functionality
- โ Production-Ready: Real-world deployment scenario with networking and service discovery
๐๏ธ Architecture
- ๐ก Stdio/JSON-RPC Communication: Lightweight, fast communication protocol
- ๐ง MCPServer Core: Central request handler and method dispatcher
- ๐ Extensible Sources: Pluggable system for different wiki platforms
- ๐ Smart Context Retrieval: Optimized search and context management
๐ Documentation
๐ง Extending
MCP Wiki Server is built to be extended:
- Add new sources in
src/sources/
and register them inMCPServer
- Implement new MCP methods in
MCPServer
as needed - Support for various wiki formats:
- Markdown
- MediaWiki
- Gitbook
- Confluence
- SharePoint
- Custom sources
๐จโ๐ป Development
# Enter development environment with Nix
nix develop
# or
just nix-shell
# Build with Nix
nix build
# or
just nix-build
See the for more details.
๐ Requirements
- Node.js 14.x or later
- For NixOS: Flakes enabled
๐ License
- Feel free to use, modify, and distribute this software.