Windjammer MCP Server
Version: 0.31.0
Status: Beta
Protocol: Model Context Protocol (MCP) 2025-06-18
Overview
The Windjammer Model Context Protocol (MCP) server enables AI assistants (Claude, ChatGPT, and others) to deeply understand, analyze, and generate Windjammer code. It provides a standardized interface for AI-powered development tools to interact with Windjammer codebases.
Key Features:
- 🤖 AI-Native: Built specifically for AI assistant integration
- 🎯 Rich Tools: Parse, analyze, generate, and refactor Windjammer code
- 🔧 Refactoring: Extract functions, inline variables, rename symbols
- 🔍 Deep Understanding: Leverages same Salsa database as LSP for consistency
- ⚡ Fast: Incremental computation with sub-millisecond cached queries
- 🛡️ Secure: Input validation, sandboxing, and resource limits
- 📚 Comprehensive: 9 tools covering code understanding, generation, refactoring, and errors
- 🌐 HTTP Transport: Streamable HTTP support with session management (MCP 2025-06-18)
Quick Start
Installation
Or build from source:
Running the Server
# Run with stdio transport (default)
# Or explicitly
# Show server info
Integration with Claude Desktop
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
Integration with Other AI Assistants
The MCP server uses JSON-RPC 2.0 over stdio, making it compatible with any AI assistant that supports MCP:
# Python example
# Start the server
=
# Send initialize request
=
# Read response
=
Available Tools
1. parse_code
Parse Windjammer code and return AST structure.
Input:
Output:
Use Cases:
- Validate syntax before code generation
- Extract structure from existing code
- Detect parse errors
2. analyze_types
Perform type inference and analysis.
Input:
Output:
Use Cases:
- Understand inferred types in code
- Verify type correctness
- Get type information at specific positions
3. generate_code
Generate Windjammer code from natural language.
Input:
Output:
Use Cases:
- Bootstrap new functions from descriptions
- Generate boilerplate code
- Learn idiomatic Windjammer patterns
4. explain_error
Explain compiler errors in plain English.
Input:
Output:
Use Cases:
- Help beginners understand errors
- Provide quick fixes for common mistakes
- Learn from error messages
5. get_definition
Find the definition of a symbol.
Input:
Output:
Use Cases:
- Navigate to function/type definitions
- Understand symbol origins
- Explore codebase structure
6. search_workspace
Search for code patterns across the workspace.
Input:
Output:
Use Cases:
- Find examples of specific patterns
- Locate functions by signature
- Understand how features are used
7. extract_function
Extract selected code into a new function (refactoring tool).
Input:
Output:
Use Cases:
- Refactor complex functions into smaller, testable units
- Extract reusable logic
- Improve code organization
8. inline_variable
Inline a variable by replacing uses with its value (refactoring tool).
Input:
Output:
Use Cases:
- Simplify code by removing unnecessary variables
- Reduce indirection
- Prepare for further refactoring
9. rename_symbol
Rename a symbol with workspace-wide updates (refactoring tool).
Input:
Output:
Use Cases:
- Rename functions, variables, types safely
- Improve naming consistency
- Refactor APIs without breaking code
Architecture
Shared Database with LSP
The MCP server shares the same Salsa-powered incremental computation database with the Windjammer LSP. This ensures:
- ✅ Consistency: Same parsing and analysis results
- ✅ Performance: Cached computations benefit both LSP and MCP
- ✅ Accuracy: No divergence between IDE and AI tools
┌──────────────┐ ┌──────────────┐
│ LSP Client │ │ MCP Client │
│ (VSCode) │ │ (Claude) │
└──────┬───────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────────────────────────┐
│ Shared Salsa Database │
│ - Incremental parsing │
│ - Type inference cache │
│ - Symbol resolution │
└──────────────────────────────────┘
Security
- Input Validation: All inputs validated against JSON schemas
- Resource Limits: Code size limited to 1MB, timeouts on operations
- Sandboxing: Analysis runs in isolated database instances
- No File System Access: By default (without explicit permission)
Examples
Example 1: Parse and Validate Code
=
# Send to server...
# Response will include AST and any parse errors
Example 2: Generate Code from Description
=
# Response includes generated Windjammer code
Example 3: Explain an Error
=
# Response includes plain English explanation and suggestions
Development
Building
Testing
Benchmarking
Protocol Reference
Initialization
Tool List
Tool Call
Shutdown
Roadmap
v0.31.1 (Current)
- Core MCP server with stdio transport
- Tools: parse, analyze, generate, explain, search, get_definition
- Refactoring tools: extract_function, inline_variable, rename_symbol
- Streamable HTTP transport (MCP 2025-06-18 spec)
- Session management with Mcp-Session-Id header
- Integration with LSP database
- Performance benchmarks
- Unit tests
v0.32.0 (Future)
- OAuth 2.0 authentication
- MCP client library for custom AI integrations
- Workspace-wide refactoring
- Advanced type analysis tools
v0.33.0 (Future)
- Custom tool plugins
- Multi-language support
- Production deployment guides
- AI agent integration examples
Contributing
We welcome contributions! See ../../CONTRIBUTING.md for guidelines.
License
Windjammer MCP is dual-licensed under either:
- MIT License (../../LICENSE-MIT)
- Apache License, Version 2.0 (../../LICENSE-APACHE)
at your option.
Links
- Main Repository: https://github.com/jeffreyfriedman/windjammer
- Windjammer Website: https://windjammer.dev (coming soon)
- MCP Specification: https://modelcontextprotocol.io/
- Issue Tracker: https://github.com/jeffreyfriedman/windjammer/issues
Questions? Open an issue or check the Windjammer Guide.