OpenAPI, SPARQL, MCP & Custom Integrations

Connect LexiChat to any REST API, SPARQL endpoint, or MCP server — including interactive MCP Apps that render live UI in the chat.

hub Overview

Beyond the built-in tools, LexiChat lets you connect external data sources as callable tools. There are four ways to do this:

description
OpenAPI Import

Paste a JSON or YAML OpenAPI 3.x spec and LexiChat automatically generates one tool per API operation. Best for well-documented public or internal APIs.

hub
SPARQL Endpoints

Query linked-data / RDF services (e.g. UK government open data). LexiChat generates a query tool plus a schema tool per endpoint, primed with your prefixes and example queries.

build
Custom Tools

Define a single HTTP endpoint with a form — name, URL template, method, and parameters. Best for simple webhooks or internal APIs without a full spec.

dashboard_customize
MCP Servers & Apps

Connect Model Context Protocol servers (stdio or HTTP) to add whole toolsets — and let them render interactive MCP Apps (live UI) right in the chat.

description OpenAPI Import

LexiChat parses OpenAPI 3.x specifications (JSON or YAML). Each operation (GET /users/{id}, etc.) becomes one tool the AI can call.

How to import a spec
1

Open the Tools panel — click the wrench icon in the toolbar, then Import OpenAPI

2

Paste your OpenAPI JSON or YAML into the text area, then click Parse

3

Review the list of detected tools (operation ID, method, path, description)

4

Click Register All — tools are now available to the AI immediately

What gets extracted
check_circle Operation ID → tool name
check_circle summary / description → tool description
check_circle Path parameters ({id}) → required params
check_circle Query parameters → optional params
check_circle Request body properties → body params
check_circle HTTP method and base URL

Example OpenAPI spec

Here's a minimal spec that exposes a weather lookup endpoint. Paste this to try it out:

{
  "openapi": "3.0.0",
  "info": {
    "title": "Weather API",
    "version": "1.0"
  },
  "servers": [
    { "url": "https://api.open-meteo.com/v1" }
  ],
  "paths": {
    "/forecast": {
      "get": {
        "operationId": "get_weather",
        "summary": "Get weather forecast for a location",
        "parameters": [
          {
            "name": "latitude",
            "in": "query",
            "required": true,
            "schema": { "type": "number" },
            "description": "Latitude of the location"
          },
          {
            "name": "longitude",
            "in": "query",
            "required": true,
            "schema": { "type": "number" },
            "description": "Longitude of the location"
          },
          {
            "name": "current_weather",
            "in": "query",
            "required": false,
            "schema": { "type": "boolean" },
            "description": "Include current conditions"
          }
        ]
      }
    }
  }
}

After importing, the AI can answer questions like "What's the weather in London?" by calling get_weather with the coordinates it looks up.

build Custom Tools

For simple HTTP integrations that don't have an OpenAPI spec, use the Custom Tool builder to define an endpoint by hand.

Custom tool fields
Field Description
Name Tool identifier shown to the model (snake_case, no spaces)
Description Tells the AI what this tool does and when to use it — be specific
URL Full URL with {param} placeholders for path params
Method GET, POST, PUT, DELETE, PATCH
Parameters Add one or more params — each has name, type, location (path/query/body), description, required flag
Parameter locations
path

Substituted directly into the URL. Requires a matching {paramName} in the URL template.

query

Appended to the URL as ?key=value. Works for GET requests and can be used with any method.

body

Sent as a JSON key in the request body. LexiChat sets Content-Type: application/json automatically.

Example: GitHub Repository Info

A custom tool to fetch public GitHub repo metadata:

Name
get_github_repo
Description
Get metadata for a public GitHub repository including stars, forks, and description
URL
https://api.github.com/repos/{owner}/{repo}
Method
GET
Parameters
owner string path The GitHub username or organisation required
repo string path The repository name required

Once registered, you can ask: "How many stars does the ollama/ollama repo have?" and the AI will call the tool automatically.

// AI generates this call
{
  "name": "get_github_repo",
  "arguments": {
    "owner": "ollama",
    "repo": "ollama"
  }
}

// LexiChat makes: GET https://api.github.com/repos/ollama/ollama
// Returns JSON → fed back to model

hub SPARQL Endpoints

SPARQL endpoints expose linked data (RDF) — UK government open data, scientific datasets, knowledge graphs, and more. Unlike REST APIs, a SPARQL service has no machine-readable contract describing its data, so instead of importing a spec you assemble a small bundle that tells the model how to query it: the endpoint URL, namespace prefixes, a short schema summary, and a few example queries.

Two tools per endpoint
…_query

The AI writes a SPARQL query and this tool runs it (SELECT, ASK, CONSTRUCT, DESCRIBE). Your prefixes, schema summary, and first example are embedded in the tool description so the model can author valid queries. Results come back as a compact table.

…_schema

Returns the full vocabulary, prefixes, and all example queries on demand. The model calls this first when it is unsure of the data model — keeping the always-on query-tool description small.

How to add an endpoint
1

Open Admin → SPARQL tab and click + Add SPARQL Endpoint

2

Enter a title and the endpoint URL, then click Test & discover — LexiChat confirms the endpoint is live and pre-fills suggested prefixes and a sampled class/property list

3

Fill in When to use (the topics this endpoint answers) and add one or two real example queries — these have the biggest impact on query quality

4

Click Add Endpoint — the query and schema tools are available immediately

lightbulb
Built-in endpoints. LexiChat ships with HM Land Registry and OpenDataCommunities (MHCLG) ready to use — they are available in every profile and toggled with the On/Off switch. Click the ▸ arrow on any endpoint to view its full read-only setup. (A decommissioned ONS endpoint is included disabled, as a template.)

Endpoint fields

Field Description
Title Human name for the endpoint — used to derive the tool names (e.g. HM Land Registryhm_land_registry_query)
Endpoint URL The SPARQL query endpoint. Queries are sent as an HTTP POST with Accept: application/sparql-results+json
When to use The topics this endpoint covers. Surfaced in the tool description and system prompt so the model prefers it over web search for matching questions
Prefixes PREFIX declarations the model should reuse, one per line
Schema / vocabulary A summary of the key classes and properties (or a pasted ontology). Keep it concise — it is sent to the model
Example queries Real, working queries with a label each. The single highest-value context for accurate query generation
Read-only On by default — rejects update operations (INSERT, DELETE, DROP, …) before they are sent
Authentication Same options as OpenAPI — none, bearer, API key, basic, or OAuth2 (see below)

Example: HM Land Registry

The built-in HM Land Registry endpoint (https://landregistry.data.gov.uk/landregistry/query) is set up to answer UK property questions. With it enabled you can ask:

"Use HM Land Registry to find recent sold prices in postcode PL6 8RU."

The AI calls hm_land_registry_query with a query like its bundled example:

PREFIX lrppi: <http://landregistry.data.gov.uk/def/ppi/>
PREFIX lrcommon: <http://landregistry.data.gov.uk/def/common/>
SELECT ?date ?price ?street ?town WHERE {
  ?txn lrppi:propertyAddress ?addr ;
       lrppi:pricePaid ?price ;
       lrppi:transactionDate ?date .
  ?addr lrcommon:postcode "PL6 8RU" .
  OPTIONAL { ?addr lrcommon:street ?street }
  OPTIONAL { ?addr lrcommon:town ?town }
} ORDER BY DESC(?date) LIMIT 20

If the model is unsure of the vocabulary it first calls hm_land_registry_schema to retrieve the prefixes and examples, then writes the query.

psychology
Helping the model choose SPARQL over web search. Smaller local models often reach for web_search by default. Filling in the When to use field and adding concrete example queries is what reliably steers the model to the SPARQL tool. Naming the endpoint in your request ("use HM Land Registry…") also works.

dashboard_customize MCP Servers

Model Context Protocol (MCP) servers expose whole toolsets — filesystems, databases, SaaS integrations, and more. LexiChat connects to them over stdio (a local command) or HTTP, discovers their tools, and makes them callable by the model.

Add a server (Admin → MCP)
stdio

Enter a launch command, e.g. npx -y @modelcontextprotocol/server-filesystem /path. LexiChat spawns it and speaks JSON-RPC over its stdin/stdout.

http

Enter an https://… URL. Add authentication (bearer, API key, OAuth2) if the server requires it.

Expand any server to enable/disable individual tools, and remember: MCP selections are per-profile. See Managing Tools.

MCP Apps interactive UI

MCP servers can go beyond text: with MCP Apps (the SEP-1865 extension, built with the MCP-UI and OpenAI Apps SDK teams) a tool can return an interactive HTML interface — a form, dashboard, chart, viewer, or generator — that renders directly in the conversation. LexiChat supports both the official ext-apps and the community MCP-UI dialects.

How it works
1

Turn on Enable interactive apps (UI) for the server (in the Add form, or per-server after expanding it). Apps are off by default.

2

When the model calls an app-enabled tool, LexiChat fetches the tool's UI resource and shows a consent prompt — the app renders only after you click Allow.

3

The app runs in a sandboxed iframe and can call the server's tools or send messages back to the chat — every UI-initiated tool call is proxied through the host with your permission.

Security model
shield Sandboxed iframe — no access to the app, your files, cookies, or storage
toggle_off Off by default; enabled per-server
verified_user Explicit consent before an app renders or calls a tool
visibility All bridge traffic is visible in the Debug panel

Try it with the ready-to-run examples in the MCP ext-apps repo (e.g. a QR generator, PDF viewer, or map). Add the server, enable apps, and ask the model to use its tool.

info
Only enable apps for servers you trust. An app is third-party HTML running locally. The sandbox and consent prompts contain it, but treat enabling apps like installing an extension.

lock Authentication

When adding an OpenAPI spec, SPARQL endpoint, or MCP connection, you can configure authentication. LexiChat supports four methods:

key
Bearer token — sends Authorization: Bearer <token> on every request.
vpn_key
API key — a custom header name and value (e.g. X-API-Key: secret).
person
Basic auth — username and password, base64-encoded automatically into the Authorization header.
open_in_browser
OAuth2 — client-credentials or authorization-code flow. For the auth-code flow, LexiChat opens your browser for the consent screen and exchanges the code for tokens automatically.

settings_applications Managing Tools

All tools (built-in, OpenAPI, and MCP) are managed in the Admin panel. From here you can:

toggle_on
Enable / Disable (OpenAPI & Built-in)
Toggle entire tools or services on or off. Disabled tools are hidden from the AI — it won't call them even if relevant. Useful for reducing the schema payload sent to the model.
checklist
Per-tool enable / disable (MCP servers)
MCP servers can expose dozens or hundreds of tools. Expand any MCP server in the Admin → MCP tab to see individual tool checkboxes. Use All / None buttons to bulk-select. The server badge updates to show enabled / total — e.g. ✓ 5/112 tools. Only enabled tools are sent to the model, keeping the context window focused.
delete
Remove Tools & Servers
Click the ✕ icon next to any OpenAPI spec or MCP server to remove it permanently. Built-in tools cannot be removed, only disabled.
Tool selections are profile-specific. Each profile stores its own MCP servers, OpenAPI specs, and SPARQL endpoints, plus per-tool enabled state. Switching profiles swaps the entire tool environment — servers, specs, endpoints, allowed directories, and tool toggles all change together. The built-in SPARQL endpoints are the exception: they are available in every profile, governed only by their own On/Off toggle.

info Current Limitations

schema
OpenAPI 3.x only. Swagger 2.0 specs are not supported. Convert with the Swagger Editor if needed.
data_object
JSON responses only. Tools must return JSON. Non-JSON responses (HTML, plain text) will be returned as raw strings to the model.
token
Context window usage. Each registered tool adds JSON schema to every request. With many tools, consider disabling unused ones to preserve context for the conversation.