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:
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.
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.
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.
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.
Open the Tools panel — click the wrench icon in the toolbar, then Import OpenAPI
Paste your OpenAPI JSON or YAML into the text area, then click Parse
Review the list of detected tools (operation ID, method, path, description)
Click Register All — tools are now available to the AI immediately
summary / description → tool description{id}) → required paramsExample 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.
| 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 |
Substituted directly into the URL. Requires a matching {paramName} in the URL template.
Appended to the URL as ?key=value. Works for GET requests and can be used with any method.
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:
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.
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.
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.
Open Admin → SPARQL tab and click + Add SPARQL Endpoint
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
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
Click Add Endpoint — the query and schema tools are available immediately
Endpoint fields
| Field | Description |
|---|---|
| Title | Human name for the endpoint — used to derive the tool names (e.g. HM Land Registry → hm_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.
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.
Enter a launch command, e.g. npx -y @modelcontextprotocol/server-filesystem /path. LexiChat spawns it and speaks JSON-RPC over its stdin/stdout.
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.
Turn on Enable interactive apps (UI) for the server (in the Add form, or per-server after expanding it). Apps are off by default.
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.
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.
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.
lock Authentication
When adding an OpenAPI spec, SPARQL endpoint, or MCP connection, you can configure authentication. LexiChat supports four methods:
Authorization: Bearer <token> on every request.X-API-Key: secret).Authorization header.settings_applications Managing Tools
All tools (built-in, OpenAPI, and MCP) are managed in the Admin panel. From here you can:
✓ 5/112 tools. Only enabled tools are sent to the model, keeping the context window focused.