| Crates.io | windjammer-mcp |
| lib.rs | windjammer-mcp |
| version | 0.39.6 |
| created_at | 2025-11-23 02:34:35.586462+00 |
| updated_at | 2026-01-07 03:00:08.736075+00 |
| description | Model Context Protocol (MCP) server for Windjammer - AI-powered development |
| homepage | |
| repository | https://github.com/jeffreyfriedman/windjammer |
| max_upload_size | |
| id | 1946025 |
| size | 267,465 |
Version: 0.31.0
Status: Beta
Protocol: Model Context Protocol (MCP) 2025-06-18
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:
cargo install windjammer-mcp
Or build from source:
cd crates/windjammer-mcp
cargo build --release
# Run with stdio transport (default)
windjammer-mcp
# Or explicitly
windjammer-mcp stdio
# Show server info
windjammer-mcp info
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"windjammer": {
"command": "/path/to/windjammer-mcp",
"args": ["stdio"]
}
}
}
The MCP server uses JSON-RPC 2.0 over stdio, making it compatible with any AI assistant that supports MCP:
# Python example
import subprocess
import json
# Start the server
server = subprocess.Popen(
["windjammer-mcp", "stdio"],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
text=True
)
# Send initialize request
request = {
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {"name": "my-client", "version": "1.0.0"}
}
}
server.stdin.write(json.dumps(request) + "\n")
server.stdin.flush()
# Read response
response = json.loads(server.stdout.readline())
print(response)
parse_codeParse Windjammer code and return AST structure.
Input:
{
"code": "fn main() { println!(\"Hello\") }",
"include_diagnostics": true
}
Output:
{
"success": true,
"ast": { ... },
"diagnostics": []
}
Use Cases:
analyze_typesPerform type inference and analysis.
Input:
{
"code": "let x = 42; let y = x + 1",
"cursor_position": {"line": 1, "column": 9}
}
Output:
{
"success": true,
"inferred_types": {
"x": "i64",
"y": "i64"
},
"type_at_cursor": "i64"
}
Use Cases:
generate_codeGenerate Windjammer code from natural language.
Input:
{
"description": "Create a function that filters even numbers from a vector"
}
Output:
{
"success": true,
"code": "fn filter_evens(numbers: Vec<int>) -> Vec<int> {\n numbers.iter().filter(|&n| n % 2 == 0).collect()\n}",
"explanation": "This function uses Windjammer's iterator methods to filter even numbers."
}
Use Cases:
explain_errorExplain compiler errors in plain English.
Input:
{
"error": "error[E0308]: mismatched types\\n expected `i64`, found `&str`",
"code_context": "let x: int = \"hello\""
}
Output:
{
"success": true,
"explanation": "You're trying to assign a string (\\\"hello\\\") to a variable declared as an integer (int). Windjammer requires types to match exactly.",
"suggestion": "Change the type to `string` or change the value to a number like `42`.",
"corrected_code": "let x: string = \"hello\" // or: let x: int = 42"
}
Use Cases:
get_definitionFind the definition of a symbol.
Input:
{
"symbol": "add",
"file": "src/main.wj",
"position": {"line": 5, "column": 10}
}
Output:
{
"success": true,
"definition": {
"file": "src/lib.wj",
"range": {
"start": {"line": 10, "column": 0},
"end": {"line": 12, "column": 1}
},
"signature": "fn add(a: int, b: int) -> int"
}
}
Use Cases:
search_workspaceSearch for code patterns across the workspace.
Input:
{
"query": "functions that return Result<T, Error>",
"file_pattern": "src/**/*.wj"
}
Output:
{
"success": true,
"results": [
{
"file": "src/lib.wj",
"matches": [
{
"line": 15,
"signature": "fn read_file(path: string) -> Result<string, Error>",
"context": "..."
}
]
}
]
}
Use Cases:
extract_functionExtract selected code into a new function (refactoring tool).
Input:
{
"code": "fn main() {\n let x = 1;\n let y = 2;\n println!(\"{}\", x + y);\n}",
"range": {
"start": {"line": 1, "column": 4},
"end": {"line": 2, "column": 17}
},
"function_name": "calculate_sum",
"make_public": false
}
Output:
{
"success": true,
"refactored_code": "fn calculate_sum(x: int, y: int) -> int {\n x + y\n}\n\nfn main() {\n let result = calculate_sum(1, 2);\n println!(\"{}\", result);\n}",
"function_signature": "fn calculate_sum(x: int, y: int) -> int",
"captured_variables": ["x", "y"]
}
Use Cases:
inline_variableInline a variable by replacing uses with its value (refactoring tool).
Input:
{
"code": "fn main() {\n let x = 42;\n println!(\"{}\", x);\n}",
"position": {"line": 1, "column": 8}
}
Output:
{
"success": true,
"refactored_code": "fn main() {\n println!(\"{}\", 42);\n}",
"occurrences_replaced": 1,
"variable_name": "x"
}
Use Cases:
rename_symbolRename a symbol with workspace-wide updates (refactoring tool).
Input:
{
"code": "fn add(a: int, b: int) -> int { a + b }",
"position": {"line": 0, "column": 7},
"new_name": "sum"
}
Output:
{
"success": true,
"refactored_code": "fn sum(a: int, b: int) -> int { a + b }",
"occurrences_renamed": 3,
"old_name": "add",
"files_affected": ["src/main.wj", "src/lib.wj"]
}
Use Cases:
The MCP server shares the same Salsa-powered incremental computation database with the Windjammer LSP. This ensures:
┌──────────────┐ ┌──────────────┐
│ LSP Client │ │ MCP Client │
│ (VSCode) │ │ (Claude) │
└──────┬───────┘ └──────┬───────┘
│ │
▼ ▼
┌──────────────────────────────────┐
│ Shared Salsa Database │
│ - Incremental parsing │
│ - Type inference cache │
│ - Symbol resolution │
└──────────────────────────────────┘
import json
request = {
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "parse_code",
"arguments": {
"code": "fn add(a: int, b: int) -> int { a + b }",
"include_diagnostics": true
}
}
}
# Send to server...
# Response will include AST and any parse errors
request = {
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "generate_code",
"arguments": {
"description": "HTTP server that responds 'Hello World' on GET /"
}
}
}
# Response includes generated Windjammer code
request = {
"jsonrpc": "2.0",
"id": 4,
"method": "tools/call",
"params": {
"name": "explain_error",
"arguments": {
"error": "cannot find value `foo` in this scope",
"code_context": "println!(foo)"
}
}
}
# Response includes plain English explanation and suggestions
cargo build --release
cargo test
cargo bench
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "client-name",
"version": "1.0.0"
}
}
}
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "tool_name",
"arguments": { ... }
}
}
{
"jsonrpc": "2.0",
"id": 4,
"method": "shutdown"
}
We welcome contributions! See ../../CONTRIBUTING.md for guidelines.
Windjammer MCP is dual-licensed under either:
at your option.
Questions? Open an issue or check the Windjammer Guide.