Oak MCP
Oak MCP is a Model Context Protocol (MCP) server implementation for the Oak framework, enabling AI models to interact directly with Oak's deep semantic analysis.
🎯 Overview
Oak MCP bridges the gap between AI agents (like Claude 3.5/4) and your source code. Unlike traditional LSP-based tools that return verbose JSON, Oak MCP is optimized for AI context windows, providing structured "code skeletons" and intelligent semantic search capabilities.
✨ Features
- Compact Format: Deeply optimized for AI context windows. Returns "code skeletons" using Oak's
RedTreearchitecture to minimize token usage. - Fuzzy Semantics: Integrated with
oak-semantic-searchfor natural language intent-based code retrieval. - Local Embedding: Uses
fastembedfor privacy-first, offline vector indexing. - LSP Bridge: Supports standard features like Hover, Definition, References, and Symbols.
- Cross-File Context: Discovers logical relationships between files that go beyond simple naming conventions.
🚀 Quick Start
Add oak-mcp to your Cargo.toml:
[]
= "0.0.1"
Running the MCP Server
use OakMcpService;
use RustService; // Example language service
async
📋 Examples
Integration with Claude Desktop
Add the following to your claude_desktop_config.json:
🏗️ Advanced Capabilities
1. Structured Summarization
Instead of sending thousands of lines of code, Oak MCP sends a hierarchical summary of symbols and their relationships, allowing the AI to understand the big picture instantly.
2. Intent-Based Search
"How does this project handle error retries?" — Oak MCP uses vector embeddings to find relevant code chunks even if the word "retry" isn't explicitly in the function name.
📊 Performance
- Token Efficiency: Up to 80% reduction in token usage compared to raw file contents.
- Low Latency: Local indexing and fast retrieval for real-time AI interactions.
🤝 Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Oak MCP - Deep code understanding for AI agents 🚀