MCP Server Integration
Connect your own MCP server to your sales agent. It can then answer visitor questions using live data from your own systems — inventory, pricing, availability, order status, and more.
Unlike the Knowledge Base REST API (which pushes static data into AgentNDX), an MCP server lets your agent call back into your systems in real time during every visitor conversation.
Connect my MCP server →What is MCP?
The Model Context Protocol (MCP) is an open standard published by Anthropic that lets AI models call tools exposed by external servers. Your MCP server defines functions (tools) that the AI can invoke — your server handles the execution and returns a result.
AgentNDX's sales agent runs on Claude via the Vercel AI SDK, both of which have native MCP support. This means we can connect your MCP server at near-zero infrastructure cost — making AgentNDX the only sales agent platform that supports live data via MCP.
Quick-start: build your server with AI
Copy this prompt into Claude, ChatGPT, or your AI coding tool to generate a working MCP server for your business in minutes:
Copy & paste this prompt
Build a minimal MCP (Model Context Protocol) server using the
@modelcontextprotocol/sdk Node.js package with HTTP/SSE transport.
My business: [describe your business — e.g. "a restaurant in Miami"]
I need these tools exposed via MCP:
- [tool 1 — e.g. "get_todays_specials() → returns tonight's menu as a string"]
- [tool 2 — e.g. "check_waitlist() → returns current wait time in minutes"]
- [tool 3 — optional]
Requirements:
1. Use HTTP/SSE transport (not stdio)
2. Listen on PORT env var, default 3001
3. Expose a /sse endpoint for MCP connections
4. Each tool should have a clear description and typed parameters
5. Include a simple Bearer token auth check using AUTH_TOKEN env var
6. Include a Dockerfile and a one-command deploy instruction for Railway or Render
The server will be connected to an AgentNDX sales agent so visitors can get
real-time answers. Return all tool results as plain strings.Replace the bracketed sections with your own business details and tools. The generated server deploys to Railway, Render, or any Node.js host in under 5 minutes.
How it works
- A visitor asks your agent a question that requires live data.
- The agent calls a tool on your MCP server (e.g.
mcp_check_availability). - Your server executes the tool and returns the result.
- The agent incorporates the live result into its response.
All MCP calls are made server-side from our API — your MCP server URL and auth token are never exposed to the visitor's browser. Tool calls time out after 3 seconds; if your server doesn't respond in time, the agent continues without the live data and logs the failure.
Use cases
🍽️ Restaurant
get_todays_specials()check_waitlist()
Agent always knows tonight's menu and current wait time — no stale knowledge base.
🛒 E-commerce
check_inventory(product_id)get_price(product_id, promo_code)
Agent accurately answers 'do you have this in blue size M?' from live stock.
📅 Service business
get_availability(date)book_slot(date, time, name)
Agent says 'yes, we have a 2pm Thursday slot' — not 'contact us to book'.
💼 SaaS / software
get_feature_status(plan)get_pricing(tier)
Agent answers plan comparison questions from live feature flags.
⚖️ Professional services
get_case_status(client_id)
Law firm agent looks up matter status during intake chat.
🚗 Auto dealer
search_inventory(make, model, year)get_financing_rate(credit_tier)
Agent tells visitors which cars are on the lot and today's financing rate.
Building your MCP server
Your MCP server must use HTTP/SSE transport (not stdio — stdio requires a local process and can't be reached over the network). It must also use an HTTPS URL — plain HTTP is rejected.
Example: Node.js (TypeScript)
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js";
import express from "express";
import { z } from "zod";
const app = express();
const server = new McpServer({ name: "my-business-mcp", version: "1.0.0" });
// Auth middleware — check Bearer token on every MCP request
app.use("/sse", (req, res, next) => {
const token = req.headers.authorization?.replace("Bearer ", "");
if (token !== process.env.AUTH_TOKEN) {
res.status(401).json({ error: "Unauthorized" });
return;
}
next();
});
// Define your tools
server.tool(
"get_todays_specials",
"Returns tonight's menu specials",
{},
async () => {
// Replace with your real data source
const specials = await fetchTonightsSpecials();
return { content: [{ type: "text", text: specials.join(", ") }] };
},
);
server.tool(
"check_availability",
"Check appointment availability for a given date",
{ date: z.string().describe("Date in YYYY-MM-DD format") },
async ({ date }) => {
const slots = await getAvailableSlots(date);
return { content: [{ type: "text", text: slots.length > 0
? `Available: ${slots.join(", ")}`
: "No slots available on this date"
}] };
},
);
// Wire up SSE transport
app.get("/sse", async (req, res) => {
const transport = new SSEServerTransport("/message", res);
await server.connect(transport);
});
app.post("/message", express.json(), async (req, res) => {
// handle incoming messages
});
app.listen(process.env.PORT ?? 3001);Example: Python (FastAPI)
from mcp.server.fastmcp import FastMCP
import uvicorn, os
mcp = FastMCP("my-business-mcp")
AUTH_TOKEN = os.environ["AUTH_TOKEN"]
@mcp.tool()
async def get_todays_specials() -> str:
"""Returns tonight's menu specials."""
# Replace with your real data source
specials = await fetch_todays_specials()
return ", ".join(specials)
@mcp.tool()
async def check_availability(date: str) -> str:
"""Check appointment availability. date: YYYY-MM-DD"""
slots = await get_available_slots(date)
if slots:
return f"Available: {', '.join(slots)}"
return "No slots available on this date"
# Mount with Bearer token middleware
app = mcp.get_sse_app()
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=int(os.environ.get("PORT", 3001)))Connecting your server to AgentNDX
- Deploy your MCP server to any HTTPS host (Railway, Render, Fly.io, Vercel, your own VPS).
- Go to Dashboard → AI Agent → Live Data tab.
- Enter your server's SSE endpoint URL (e.g.
https://my-server.railway.app/sse). - Optionally enter an auth header (e.g.
Authorization: Bearer my-secret). - Click Test Connection — you'll see your exposed tools listed if the connection succeeds.
- Toggle Enable, click Save Settings.
Your agent will now call your MCP tools during live conversations. Tools are prefixed with mcp_ internally to prevent naming conflicts with built-in tools.
Security model
| Requirement | Detail |
|---|---|
| HTTPS only | HTTP and localhost URLs are rejected at save time. |
| Server-side calls only | All MCP tool calls originate from our API. Your MCP server URL is never sent to the visitor's browser. |
| 3-second timeout | If your MCP server doesn't respond within 3 seconds, the agent continues without it and logs the failure. |
| Reserved tool names | The lead_capture tool is reserved. MCP tools are prefixed with mcp_ to prevent conflicts. |
| Tool schema validation | We reject tools that declare filesystem paths, shell commands, or network addresses as parameters. |
| Auth header encrypted at rest | Your MCP auth header is stored encrypted in the database — never in plaintext. |
| Rate limits | Max 10 MCP tool calls per conversation turn, max 50 per conversation. |
Tool naming
All tools from your MCP server are automatically prefixed with mcp_ when passed to the agent. So a tool named check_availability on your server becomes mcp_check_availability in the agent. This prevents conflicts with AgentNDX's built-in tools (like lead_capture).
Use the Tool allowlist field in the dashboard to restrict which tools the agent can call. Leave it blank to allow all tools exposed by your server.
Limits
| Limit | Value |
|---|---|
| MCP servers per page | 1 (Phase 1) |
| Tool call timeout | 3 seconds |
| Tool calls per turn | 10 |
| Tool calls per conversation | 50 |
| Tool allowlist size | 50 entries |
| Auth header length | 500 characters |
| Plan required | Business |
Error handling
If your MCP server is unreachable, returns an error, or times out:
- The agent continues the conversation without the live data.
- The failure is logged and visible in your Sentry dashboard.
- The agent falls back to its knowledge base and will say “I'm not able to check that right now — let me connect you with the team.”
Design your tools to return plain strings for best results. The agent handles JSON but plain text is easier to incorporate into natural conversation.
Ready to connect your live data?
MCP server integration is available on the Business plan. Deploy your server, paste the URL, and your agent starts answering with live data in minutes.