Browse topics Connect AI chat to MCP
Connect your app
Connect AI chat to MCP
Give your AI assistant access to useful data from your app. You choose the tools; SupaKnock brings them into the conversation.
MCP is a standard way for an application to expose tools to an AI assistant. Connect your server to let SupaKnock look up public product details, search documentation, check published service information or retrieve other visitor-safe data. Your backend owns the data and enforces access; your project chooses what the assistant may use.
Before you start: your installed SupaKnock server must include Connected AI tools. Check its /api/v1/openapi.json for MCP connection routes. These docs cover current source; publishing them does not upgrade your installation.
Build a tool · Connection setup · Testing · Podcast example · Resources
Your app supplies tools. SupaKnock manages the chat.
- Your MCP server describes its tools and answers read requests using your application’s data.
- Your administrator reviews those tools and explicitly approves which each project can use.
- SupaKnock makes the approved calls when needed, treats their results as evidence and answers within the project’s AI rules.
This release supports public, read-only data. A dedicated service token can protect the endpoint, but it does not authenticate an individual visitor. Writes, private user data and delegated customer actions are not supported yet.
You can use connected tools alone without embeddings, or combine them with approved support knowledge. Normal support and human handoff stay in the existing chat.
1. Expose a small, useful tool
Start with a focused read: look up a public product, find a documentation passage or retrieve published service status. Give the tool a clear description and bounded inputs. Your server must enforce read-only behavior and public visibility; tool annotations describe intent, not permissions.
Here is an illustrative entry in a tools/list result:
{
"name": "get_public_product",
"description": "Read current public details for one product.",
"annotations": {
"readOnlyHint": true,
"destructiveHint": false
},
"inputSchema": {
"type": "object",
"properties": {
"product_id": {"type": "string", "minLength": 1, "maxLength": 100}
},
"required": ["product_id"],
"additionalProperties": false
}
}A successful tools/call result can return a concise text block:
{
"content": [{
"type": "text",
"text": "Product: Desk lamp. Finish: matte white. Availability: in stock."
}],
"isError": false
}These are result objects inside standard MCP JSON-RPC responses. Structured results are also supported. When both text and structuredContent are returned, serialize the same object into text. Generic results appear as bounded evidence under your connection’s label; SupaKnock does not infer clickable links from them.
Use public HTTPS with MCP 2025-11-25 Streamable HTTP. SupaKnock supports initialization, tool discovery and calls with bounded JSON or SSE responses. Read the full compatibility contract before choosing schema features: references, unions and compositions are not supported.
2. Connect and approve your tools
- Host an MCP 2025-11-25 Streamable HTTP endpoint at a public HTTPS URL. Implement initialization, discovery and tool calls. Redirects and private-network addresses are not accepted.
- In account administration, open Connected AI tools. Save the endpoint and optional dedicated bearer token, enable availability for projects and add the exact HTTPS origins allowed for citation links.
- Select Discover tools, review their schemas and run a read-only test with public data. Discovery alone never enables tools for visitors.
- Open Project settings → AI support → Connected tools. Select the tools and source mode. For podcasts, select Episode on the visitor’s page.
- In Models & keys, verify tool access for the exact generation keys and model. Explicitly enable AI after readiness checks pass.
Choose Connected tools only for live app data, or Support knowledge and connected tools to include approved support documents. Existing projects stay knowledge-only until you change them. Connection edits require discovery and project approvals again.
3. Test answers and failure cases
- Ask a question that needs a tool and confirm the answer matches the returned data.
- Try missing and private records. They must not expose private information or become invented facts.
- Simulate timeouts, invalid credentials and oversized results. The assistant should explain that it cannot get the information.
- Change or remove a tool approval and check that it can no longer be used.
- Verify normal support questions, topic restrictions and human handoff still work.
If a connection does not work
Discovery fails: check the exact HTTPS endpoint, service-token scope, protocol version, redirects and schema subset. AI is not ready: check project tool selection, source mode and the generation model’s verified tool access. Results are rejected: check content types, byte limits and consistency between text and structured content.
Only evidence actually cited in a completed answer is saved with it. Unused results are discarded. Credentials stay encrypted; private follow-up email and visitor cookies are not attached to MCP requests. Ask only for data your server is allowed to disclose to visitors.
Example: ask questions about a podcast
A podcast is one example of an MCP integration. SupaKnock includes an optional episode-context binding and a transcript result contract for timestamped sources. Use the three tools below only if you are building this kind of integration; ordinary MCP tools do not need them.
get_episode
Resolve a public episode ID to its canonical identity, title, duration and transcript status. Return an immutable transcript revision when ready.
search_transcript
Find up to six exact excerpts within that episode and revision. Return stable segment IDs, truthful timing and canonical timestamp links.
get_transcript_window
Read a contiguous window of up to 120 seconds for nearby context. Report whether the window is complete; do not fabricate missing speech.
SupaKnock supplies the selected episode and revision itself. Your server must still recheck public visibility on every read. Times are in seconds; convert stored millisecond offsets. A transcript revision change must never mix old and new excerpts in one answer.
View example tool definitions and results →
The full contract defines exact fields, status values, supported schemas and byte limits. These are required for compatibility. Generic read tools can return bounded text evidence; the three podcast tools enable richer transcript sources.
For the podcast example: pass page context
Generic MCP connections use your existing widget without extra browser configuration. The optional podcast binding needs an episode ID. For a static episode page:
<div id="podcast-chat"></div>
<script src="https://YOUR-SUPAKNOCK/widget.js"></script>
<script>
const chat = SupaKnockChat.mount('#podcast-chat', {
server: 'https://YOUR-SUPAKNOCK',
project: 'YOUR_PROJECT',
presentation: 'bar',
context: {
version: 1,
resource: {kind: 'podcast_episode', id: 'EPISODE_ID'}
}
});
// Call from your existing “Ask about this episode” button:
// chat.open({intent: 'episode'});
</script>For a single-page app, use setContextProvider to read the current route and matching player position when a visitor sends a message. Clear context with chat.setContext(null) when leaving episode pages. Keep one mounted widget; opening support uses chat.open({intent: 'support'}).
Citation links open the source in a new tab by default. An optional onSourceActivate callback can seek your existing player after validating the episode and timestamp. It must not autoplay. Full callback and route-change examples are in the integration contract.
Resources to build with
MCP agent checklist ↗
A general implementation handoff for any public, read-only app integration.
Full integration contract ↗
Supported transport, schemas, credentials, limits and lifecycle behavior.
Podcast example: JSON ↗
Copyable tool definitions and structured result examples in JSON.
Podcast example: checklist ↗
Backend, frontend, setup and acceptance checks for your app’s agent.
SupaKnock API reference ↗
Connection administration and project configuration endpoints.
Protocol references: MCP tools and Streamable HTTP. SupaKnock supports the narrower subset described in its integration contract.
These docs describe the current source. Check your server’s /api/v1/openapi.json for the version you run.