Aexol LSP & Remote MCP Quick Reference

Quick Start

Remote MCP (Model Context Protocol) - For AI Agents

# Initialize JSON-RPC session
curl -X POST "https://api.aexol.ai/mcp" \
  -H "Authorization: Bearer sk-aexol-team-..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"clientInfo":{"name":"quick-ref","version":"1.0.0"}}}'

# List tools from backend MCP
curl -X POST "https://api.aexol.ai/mcp" \
  -H "Authorization: Bearer sk-aexol-team-..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

Remote MCP Prerequisites

  • Remote operations are served by the backend MCP endpoint (/mcp).
  • Authenticate with a team API key (sk-aexol-team-...) when using backend /mcp.
  • See Remote MCP Configuration for JSON-RPC flow examples.

LSP (Language Server Protocol) - For IDEs

# Show LSP capabilities
aexol lsp --info

# Start LSP server over stdio
aexol lsp --stdio

Remote MCP Reference

MethodPurpose
initializeStart JSON-RPC session and negotiate capabilities
pingHealth check connection
tools/listList available remote tools
tools/callExecute a remote tool

Remote MCP Tools

Remote remote_* tools are available from the backend /mcp endpoint (team API key).


Programmatic Usage

Remote MCP Client

Use HTTP JSON-RPC against backend /mcp with a team key (sk-aexol-team-...).

See Remote MCP Configuration for request/response examples.

LSP Server

import { languageServer } from "./src/lsp/server.ts";

// Open document
languageServer.openDocument(uri, content);

// Get diagnostics
const diagnostics = languageServer.getDiagnostics(uri);

// Get completions
const completions = languageServer.getCompletions({
  textDocument: { uri },
  position: { line: 5, character: 10 }
});

Integration Examples

Remote MCP via HTTP JSON-RPC

Use your MCP client/server integration against backend /mcp with Bearer sk-aexol-team-....

Core methods: initialize, ping, tools/list, tools/call.

Neovim (LSP)

Add to your Neovim config:

require('lspconfig').aexol.setup{
  cmd = { 'aexol', 'lsp', '--stdio' },
  filetypes = { 'aexol' },
}

VS Code (LSP)

Already integrated in vscode-extension/


Output Formats

MCP Tool Outputs

// Success
{
  "content": [
    { "type": "json", "json": {...} }
  ],
  "isError": false
}

// Error
{
  "content": [
    { "type": "text", "text": "Error message" }
  ],
  "isError": true
}

LSP Diagnostics

{
  range: {
    start: { line: 5, character: 10 },
    end: { line: 5, character: 20 }
  },
  severity: 1, // 1=Error, 2=Warning, 3=Info, 4=Hint
  message: "Expected '{' after visitor",
  code: "SYNTAX_ERROR",
  source: "aexol"
}

Common Use Cases

1. Remote Health Check

#!/bin/bash
# healthcheck-mcp.sh
curl -s -X POST "https://api.aexol.ai/mcp" \
  -H "Authorization: Bearer sk-aexol-team-..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":10,"method":"ping"}'

2. Remote Tool Listing

# List remote tools
curl -s -X POST "https://api.aexol.ai/mcp" \
  -H "Authorization: Bearer sk-aexol-team-..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":11,"method":"tools/list"}'

3. AI Agent Integration

Use an MCP-capable client configured for backend /mcp and JSON-RPC tools/call.


Documentation


Troubleshooting

MCP tool not found

curl -s -X POST "https://api.aexol.ai/mcp" \
  -H "Authorization: Bearer sk-aexol-team-..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":12,"method":"tools/list"}'

LSP not working

// Check server is initialized
import { languageServer } from "./src/lsp/server.ts";
console.log(languageServer);  // Should be defined

Invalid JSON-RPC payload

# Use proper JSON escaping and include jsonrpc/method/id
curl -X POST "https://api.aexol.ai/mcp" \
  -H "Authorization: Bearer sk-aexol-team-..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":13,"method":"ping"}'

Quick Tip: Run examples to see everything in action!

deno run -A examples/lsp-integration-example.ts