Integrations

Connect Falcon with your IDE, CI/CD pipeline, and third-party tools via MCP, HTTP API, Rust SDK, and LSP.

1. MCP Server

Falcon provides an MCP (Model Context Protocol) server that exposes Falcon's analysis capabilities to AI assistants like Cursor. Run it with falcon-mcp or falcon x mcp.

What is MCP?

MCP (Model Context Protocol) is a standard that lets AI tools discover and invoke external tools. Falcon's MCP server exposes static analysis, scoring, and fix capabilities so your AI assistant can analyze code, explain rules, and suggest fixes directly in context.

Configure in Cursor

Add Falcon to your Cursor MCP settings (~/.cursor/mcp.json or project-level config):

{
  "mcpServers": {
    "falcon": {
      "command": "falcon-mcp"
    }
  }
}

Available Tools

Falcon exposes 7 MCP tools:

Example: tools/list

// JSON-RPC request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list"
}

// Response (simplified)
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      { "name": "falcon_analyze", "description": "Analyze project..." },
      { "name": "falcon_check_file", "description": "Check single file..." }
      // ... 5 more
    ]
  }
}

Example: tools/call with falcon_check_file

// Request
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "falcon_check_file",
    "arguments": {
      "path": "lib/main.dart",
      "source": "void main() { print('hi'); }"
    }
  }
}

// Response
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      { "type": "text", "text": "{\"issues\":[],\"score\":100}" }
    ]
  }
}

2. HTTP API

Run Falcon as an HTTP server with falcon x api --port 8090 to integrate with webhooks, custom dashboards, or other services.

Endpoints

Method Path Description
POST /analyze Analyze project or source code
POST /score Get AI quality score
POST /check-file Check a single file
GET /health Health check
GET /tools List available tools

Example: POST /analyze

curl -X POST http://localhost:8090/analyze \
  -H "Content-Type: application/json" \
  -d '{"source": "void main() { print(\"hello\"); }"}'

Example: POST /score

curl -X POST http://localhost:8090/score \
  -H "Content-Type: application/json" \
  -d '{"project_path": "/path/to/flutter/project"}'

Example: GET /health

curl http://localhost:8090/health
// Response
{
  "status": "ok",
  "version": "0.1.0"
}

3. Rust SDK

Use Falcon programmatically from Rust via the falcon::sdk crate.

Add as dependency

// Cargo.toml
[dependencies]
falcon = { git = "https://github.com/viveky259259/falcon" }

Analyze project

use falcon::sdk::{analyze_project, AnalyzeOptions};

let result = analyze_project("/path/to/project", AnalyzeOptions::default())?;
for issue in result.issues {
    println!("{:?}", issue);
}

Analyze single file

use falcon::sdk::analyze_source;

let source = r#"void main() { print('hi'); }"#;
let result = analyze_source(source)?;

Score project

use falcon::sdk::score_project;

let score = score_project("/path/to/project")?;
println!("Score: {}/100", score.total);

Analyze to JSON

use falcon::sdk::analyze_to_json;

let json = analyze_to_json("/path/to/project")?;
println!("{}", json);

4. LSP Server

Falcon provides an LSP (Language Server Protocol) server (falcon-lsp) for real-time diagnostics and code actions in your editor.

VS Code extension setup

Install the Falcon VS Code extension from the marketplace, or build from source. The extension automatically discovers falcon-lsp on your PATH.

Features

Configuration

Add to your settings.json:

{
  "falcon.enabled": true,
  "falcon.lspPath": "falcon-lsp",
  "falcon.rules": ["prefer_const", "avoid_print"]
}

5. Partner Integrations

Partner Status
Cursor Certified
VS Code Certified
GitHub Actions Certified
GitLab CI In Progress
Windsurf In Progress
Copilot Planned