TrueNAS Middleware MCP Server
Provides optimized documentation and API patterns from the TrueNAS middleware repository to help AI assistants understand its codebase structure without context overload. It automatically processes CLAUDE.md files to expose categorized resources including plugin guides, API models, and testing patterns.
README
TrueNAS Middleware MCP Server
This MCP (Model Context Protocol) server provides optimized documentation resources from the TrueNAS middleware repository to Code Claude, helping it understand the codebase structure and APIs without context overload.
Quick Start
- For Code Claude Integration: See INTEGRATION_GUIDE.md
- For Usage in Code Claude: See QUICK_REFERENCE.md
- For Adding Documentation: See DOCUMENTATION_GUIDE.md
- For Plugin Doc Template: See PLUGIN_DOCUMENTATION_TEMPLATE.md
- For Development Plans: See ACTION_PLAN.md
Features
- Automatically discovers and processes all CLAUDE.md files in the middleware repository
- Organizes documentation into logical categories (Overview, Plugins, API, Testing, Subsystems)
- Provides concise, focused resources to avoid context overload
- Implements intelligent content summarization
Setup Options
Option 1: Native Python (Recommended)
- Create and activate the virtual environment:
python3.11 -m venv venv_tn_mcp
source venv_tn_mcp/bin/activate # On Windows: venv_tn_mcp\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Run the server:
./run_server.sh # Or: python truenas_mcp_server.py
Option 2: Docker Container
- Build the Docker image:
docker-compose build
- Run the server:
docker-compose run --rm truenas-mcp
Available Resources
The server provides the following types of resources:
Overview Resources
truenas://overview- High-level middleware architecturetruenas://development/guidelines- Development best practices
Plugin Resources
truenas://plugins/service-types- Guide to service base classestruenas://plugins/patterns- Common plugin patternstruenas://plugins/categories- Categorized plugin listtruenas://plugins/{plugin_name}- Specific plugin documentation
API Resources
truenas://api/versioning- API versioning guidetruenas://api/models- Pydantic model patterns
Testing Resources
truenas://testing/overview- Testing guidetruenas://testing/patterns- Common testing patterns
Subsystem Resources
truenas://subsystems/{name}- Documentation for specific subsystems
Integration with Code Claude
See INTEGRATION_GUIDE.md for detailed setup instructions.
Quick Config (add to claude_desktop_config.json):
{
"mcpServers": {
"truenas-docs": {
"command": "/path/to/venv_tn_mcp/bin/python",
"args": ["/path/to/tn_mcp/truenas_mcp_server.py"]
}
}
}
How It Works
- The server scans the middleware repository for all CLAUDE.md files
- Each file is processed and categorized based on its location
- Content is intelligently summarized to reduce context size
- Resources are exposed via MCP protocol for Code Claude to query
Optimization Strategy
To avoid context overload, the server:
- Extracts key sections from documentation
- Limits code examples to essential ones
- Focuses on API signatures and patterns rather than full implementations
- Groups related information into logical resources
Running Tests
Tests are run using Docker to ensure a consistent environment.
Run All Tests
docker-compose run --rm truenas-mcp-test
Run Specific Test File
docker-compose run --rm truenas-mcp-test pytest tests/test_truenas_mcp_tools_server.py -v
Run with Coverage
docker-compose run --rm truenas-mcp-test pytest --cov=. --cov-report=html
Running Middleware Tests
The server includes a tool for running TrueNAS middleware tests. Use the run_middleware_tests.sh script:
# Run all middleware tests
./run_middleware_tests.sh
# Run a specific test file
./run_middleware_tests.sh . test_construct_schema.py
# Clean up test container
./run_middleware_tests.sh /path/to/middleware --cleanup
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.