Connect your MCP server
Give your users' AI assistants three tools through your own MCP server: report feedback, search your help docs and contact your support team.
Updated Dec 3, 2026
If you run an MCP server for your own product, it can give your users' AI assistants three tools that work through Sleekplan: report feedback, search your help docs and contact your support team. Each tool is one call from your server to the REST API v2, made with your workspace's API key for the user your server signed in.
This is not Sleekplan's MCP server. That one is hosted by Sleekplan and connects your team's AI clients to your Sleekplan workspace. Here, your own server calls Sleekplan on behalf of your users.
How it works
| Tool | What it does | API call |
|---|---|---|
report_feedback | Sends feedback: something the user couldn't do, an idea or a problem | POST /v2/intelligence/intake |
search_help_docs | Finds answers in your published docs | POST /v2/docs/search |
contact_support | Starts a conversation with your support team | POST /v2/conversations |
- The API key stays on your server. Copy it from Settings → Developer and send it as a Bearer token. Anyone who has it can make requests on behalf of your workspace, so it never goes to the AI client. See REST API keys.
- The model fills only each tool's own fields, such as the feedback text or the search query. Your server adds the rest: the user,
source: "mcp"and anIdempotency-Key. - A field the model leaves out can be sent as
null. It means the same as not sending it (Request bodies). - The three tools share your workspace's API limit of 300 requests a minute (Rate limits).
Before you start
Each tool needs part of Sleekplan to be on. Otherwise the API answers with an error and writes nothing.
| Tool | Needs | Answer otherwise |
|---|---|---|
report_feedback | Sleek Intelligence on, in Settings → Sleek Intelligence (Starter plan and above) | 409 intelligence_off |
report_feedback | The MCP row enabled in Settings → Feedback Channels → Channels. It's off by default | 409 source_off |
report_feedback | Sleek Intelligence credits left | 402 credits_exhausted |
search_help_docs | Docs on, in Settings → Modules | 409 docs_off |
contact_support | Sleekmate for end users on, in Settings → Sleekmate for end users | 409 ask_off |
contact_support | A signed-in user | 400 user_required |
The MCP row covers reports sent with source: "mcp" (how to turn it on). A report without source counts as api and follows the API endpoint row instead.
Reports and new conversations also have caps. Reports are capped at 10 a day per user, 30 a day for reports without a user, and 200 an hour and 1,000 a day per workspace. A user can start 10 conversations an hour, and a workspace 1,000 a day. Over a cap, the answer is 429 rate_limited with a Retry-After header.
The user the assistant works for
Your server names the person each call is for in user, taken from its own signed-in user:
data_id string
Your own ID for the user, up to 255 characters: the id you put in their single sign-on token. When you send both fields, data_id decides.
email string
The user's email address.
Fill user only from the user your server signed in, never from a tool argument: a model can be talked into naming someone else, and Sleekplan would then report feedback or start a conversation in that person's name.
When nobody is signed in, leave user out. When Sleekplan finds nobody, each tool answers differently:
| Tool | data_id matches nobody | Only email, and it matches nobody | No user |
|---|---|---|---|
report_feedback | 404 user_not_found | 404 user_not_found | An anonymous report |
search_help_docs | Only articles not limited to a segment | Only articles not limited to a segment | Only articles not limited to a segment |
contact_support | 404 user_not_found | A new contact with that address | 400 user_required |
A user who matches also finds the articles limited to their segments. Two of your users with the same data_id or email answer 409 identity_conflict, and matching never changes anyone's ID or address.
The tools
Use these names, descriptions and input schemas with your product's name in place of Acme. Each description says what its tool does and gives the model no instructions, and the annotations say what the tool changes. Directory reviews check both: Anthropic's directory policy asks for descriptions that match what a tool does and for the title, readOnlyHint and destructiveHint annotations, and OpenAI's Apps SDK requires readOnlyHint, destructiveHint and openWorldHint.
Report feedback
- Name:
report_feedback - Title: Report feedback
- Calls:
POST /v2/intelligence/intake - Annotations:
readOnlyHint: false,destructiveHint: false,openWorldHint: false. It adds feedback, or a vote on a post, to your own workspace and deletes nothing.
Sends the user's feedback about Acme to the Acme team: something they couldn't do, an idea, or a problem. It's matched to an existing request or filed as a new one.{
"type": "object",
"properties": {
"text": {
"type": "string",
"minLength": 1,
"maxLength": 10000,
"description": "What the user wants or what went wrong, in their own words."
},
"kind": {
"type": "string",
"enum": ["missing_capability", "idea", "problem"],
"description": "missing_capability: the user tried to do something Acme can't do. idea: a suggestion. problem: something doesn't work as expected."
},
"title": {
"type": "string",
"maxLength": 200,
"description": "A one-line summary."
},
"context": {
"type": "string",
"maxLength": 4000,
"description": "What the user was doing when this came up, and what was tried."
}
},
"required": ["text"],
"additionalProperties": false
}Your server sends the model's fields with source: "mcp" and the user:
{
"source": "mcp",
"kind": "missing_capability",
"title": "Export invoices as CSV",
"text": "I want to export last quarter's invoices as one CSV file for my accountant.",
"context": "The user asked for a CSV of their Q3 invoices. Acme's tools only download invoices one at a time, as PDF.",
"user": { "data_id": "usr_1042" }
}If your server knows which AI client is calling, add client with its name and version. A report that waits in Review shows it there.
Sleekplan answers 202 with an intake_id right away and works on the report in the background: it compares the report with your posts and either adds the user's vote to the matching post or writes a new one. Sources has the details, such as what happens to a report without a user. A report uses 1 Sleek Intelligence credit when it matches a post and 2 when it becomes a new post.
Search the help docs
- Name:
search_help_docs - Title: Search the help docs
- Calls:
POST /v2/docs/search - Annotations:
readOnlyHint: true,destructiveHint: false,openWorldHint: false. It only reads your published docs.
Searches Acme's published docs and returns up to 10 results, each with a title, an excerpt and a link.{
"type": "object",
"properties": {
"query": {
"type": "string",
"minLength": 1,
"maxLength": 200,
"description": "What to look for. A few keywords work best."
}
},
"required": ["query"],
"additionalProperties": false
}The model's query goes into q:
{
"q": "export invoices csv",
"user": { "data_id": "usr_1042" }
}Your server can add tab, the slug of one of your docs tabs, to search only that tab, and lang, the user's language. A language your board doesn't offer reads as your default one. Sleekplan answers 200 with items: each has id, kind (article or endpoint), title, text (an excerpt), url, tab and language. Give the model at least title, text and url, so it can answer from the excerpt and link the page. A search uses no credits.
Contact support
- Name:
contact_support - Title: Contact support
- Calls:
POST /v2/conversationswithfrom: "user": the user writes first, as if they had emailed your support team - Annotations:
readOnlyHint: false,destructiveHint: false,openWorldHint: false. It starts a conversation in your own inbox and deletes nothing.
Sends the user's message to Acme's support team as a new conversation. Replies reach the user by email.{
"type": "object",
"properties": {
"subject": {
"type": "string",
"minLength": 1,
"maxLength": 150,
"description": "One line that sums up the request."
},
"message": {
"type": "string",
"minLength": 1,
"maxLength": 10000,
"description": "The user's message to the support team."
}
},
"required": ["subject", "message"],
"additionalProperties": false
}The model's message goes into text:
{
"from": "user",
"source": "mcp",
"user": { "data_id": "usr_1042", "email": "jane@example.com" },
"subject": "My October invoice won't download",
"text": "Downloading the October invoice shows an error. Could you send it to me by email?"
}Sleekplan answers 201 with the conversation and its first message. The conversation waits for your team in your inbox, where its details show Started by Customer via MCP. Your team's replies reach the user by email: at the address on their Sleekplan account when they match one of your users, otherwise at the email you sent. A matched user whose account has no email address answers 409 no_address. Sleekmate answers the conversation too when Sleek Intelligence is on and, under Channels in Settings → Sleekmate for end users, both the Receive emails switch on the Email row and Sleekmate answers emails are on.
Retries
A call that timed out may have reached Sleekplan anyway. Give every call of report_feedback and contact_support its own Idempotency-Key, a new UUID, and send that key again only when you retry the same call. Sleekplan then answers the first result again instead of filing the feedback twice or starting a second conversation. A search is a read and needs no key. The rules are in Safe retries.
Example code
Both examples register report_feedback with two helpers the other tools share. They use the current official SDKs: @modelcontextprotocol/server 2.x for Node.js, and mcp 2.x for Python, where FastMCP is now called MCPServer. The Python example also uses HTTPX.
The user comes from the token your MCP server verified. In Node.js, that's what your token verifier attached to ctx.http.authInfo.extra (here userId and email). In Python, it's the subject and claims of the AccessToken your TokenVerifier built.
import { randomUUID } from 'node:crypto';
import { McpServer, type ServerContext } from '@modelcontextprotocol/server';
import * as z from 'zod/v4';
// The user your server signed in, from what your token verifier attached. Never from tool arguments.
function sleekplanUser(ctx: ServerContext) {
const extra: Record<string, unknown> = ctx.http?.authInfo?.extra ?? {};
const dataId = typeof extra.userId === 'string' ? extra.userId : undefined;
const email = typeof extra.email === 'string' ? extra.email : undefined;
return dataId || email ? { data_id: dataId, email } : undefined;
}
async function sleekplan(path: string, body: object, idempotencyKey?: string) {
const send = () =>
fetch(`https://api.sleekplan.com/v2${path}`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SLEEKPLAN_API_KEY}`,
'Content-Type': 'application/json',
...(idempotencyKey ? { 'Idempotency-Key': idempotencyKey } : {}),
},
body: JSON.stringify(body),
signal: AbortSignal.timeout(10_000),
});
// A call that timed out may have arrived: the retry sends the same key, so Sleekplan acts once.
const response = await send().catch(send);
const answer = (await response.json()) as { status: string; data: any };
if (answer.status !== 'success') {
const reason = answer.data?.message ?? answer.data?.errors?.map((e: { message: string }) => e.message).join(' ');
throw new Error(reason || 'Sleekplan could not take the request.');
}
return answer.data;
}
export function registerSleekplanTools(server: McpServer) {
server.registerTool(
'report_feedback',
{
title: 'Report feedback',
description:
"Sends the user's feedback about Acme to the Acme team: something they couldn't do, an idea, or a problem. It's matched to an existing request or filed as a new one.",
inputSchema: z.object({
text: z.string().min(1).max(10000).describe('What the user wants or what went wrong, in their own words.'),
kind: z
.enum(['missing_capability', 'idea', 'problem'])
.describe("missing_capability: the user tried to do something Acme can't do. idea: a suggestion. problem: something doesn't work as expected.")
.optional(),
title: z.string().max(200).describe('A one-line summary.').optional(),
context: z.string().max(4000).describe('What the user was doing when this came up, and what was tried.').optional(),
}),
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },
},
async (args, ctx) => {
// One key per tool call: only a retry of this call sends it again.
await sleekplan('/intelligence/intake', { ...args, source: 'mcp', user: sleekplanUser(ctx) }, randomUUID());
return { content: [{ type: 'text', text: 'Sent to the Acme team.' }] };
},
);
}import os
from typing import Annotated, Literal
from uuid import uuid4
import httpx
from pydantic import Field
from mcp.server import MCPServer
from mcp.server.auth.middleware.auth_context import get_access_token
from mcp.server.mcpserver.exceptions import ToolError
from mcp.types import ToolAnnotations
mcp = MCPServer("Acme") # your existing server
def sleekplan_user() -> dict | None:
# The user your server signed in, from the token your verifier built. Never from tool arguments.
token = get_access_token()
if token is None:
return None
data_id, email = token.subject, (token.claims or {}).get("email")
return {"data_id": data_id, "email": email} if data_id or email else None
async def sleekplan(path: str, body: dict, idempotency_key: str | None = None) -> dict:
headers = {"Authorization": f"Bearer {os.environ['SLEEKPLAN_API_KEY']}"}
if idempotency_key:
headers["Idempotency-Key"] = idempotency_key
async with httpx.AsyncClient(base_url="https://api.sleekplan.com/v2", timeout=10) as client:
try:
response = await client.post(path, json=body, headers=headers)
except httpx.TransportError:
# A call that timed out may have arrived: the retry sends the same key, so Sleekplan acts once.
response = await client.post(path, json=body, headers=headers)
answer = response.json()
if answer.get("status") != "success":
data = answer.get("data", {})
reason = data.get("message") or " ".join(error["message"] for error in data.get("errors", []))
raise ToolError(reason or "Sleekplan could not take the request.")
return answer["data"]
@mcp.tool(
title="Report feedback",
annotations=ToolAnnotations(read_only_hint=False, destructive_hint=False, open_world_hint=False),
)
async def report_feedback(
text: Annotated[str, Field(min_length=1, max_length=10000, description="What the user wants or what went wrong, in their own words.")],
kind: Annotated[
Literal["missing_capability", "idea", "problem"] | None,
Field(description="missing_capability: the user tried to do something Acme can't do. idea: a suggestion. problem: something doesn't work as expected."),
] = None,
title: Annotated[str, Field(max_length=200, description="A one-line summary.")] = "",
context: Annotated[str, Field(max_length=4000, description="What the user was doing when this came up, and what was tried.")] = "",
) -> str:
"""Sends the user's feedback about Acme to the Acme team: something they couldn't do, an idea, or a problem. It's matched to an existing request or filed as a new one."""
# One key per tool call: only a retry of this call sends it again.
await sleekplan(
"/intelligence/intake",
{"source": "mcp", "kind": kind, "title": title, "text": text, "context": context, "user": sleekplan_user()},
idempotency_key=str(uuid4()),
)
return "Sent to the Acme team."The other two tools follow the same pattern, with the helpers above:
// In registerSleekplanTools, next to report_feedback
server.registerTool(
'search_help_docs',
{
title: 'Search the help docs',
description: "Searches Acme's published docs and returns up to 10 results, each with a title, an excerpt and a link.",
inputSchema: z.object({
query: z.string().min(1).max(200).describe('What to look for. A few keywords work best.'),
}),
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
},
async ({ query }, ctx) => {
const { items } = await sleekplan('/docs/search', { q: query, user: sleekplanUser(ctx) });
const results = items.map((item: { title: string; url: string; text: string }) => `${item.title}\n${item.url}\n${item.text}`);
return { content: [{ type: 'text', text: results.join('\n\n') || 'No results.' }] };
},
);
server.registerTool(
'contact_support',
{
title: 'Contact support',
description: "Sends the user's message to Acme's support team as a new conversation. Replies reach the user by email.",
inputSchema: z.object({
subject: z.string().min(1).max(150).describe('One line that sums up the request.'),
message: z.string().min(1).max(10000).describe("The user's message to the support team."),
}),
annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },
},
async ({ subject, message }, ctx) => {
const user = sleekplanUser(ctx);
if (!user) throw new Error('Sign in to Acme to contact support.');
await sleekplan('/conversations', { from: 'user', source: 'mcp', user, subject, text: message }, randomUUID());
return { content: [{ type: 'text', text: 'Sent to Acme support. The reply comes by email.' }] };
},
);@mcp.tool(
title="Search the help docs",
annotations=ToolAnnotations(read_only_hint=True, destructive_hint=False, open_world_hint=False),
)
async def search_help_docs(
query: Annotated[str, Field(min_length=1, max_length=200, description="What to look for. A few keywords work best.")],
) -> str:
"""Searches Acme's published docs and returns up to 10 results, each with a title, an excerpt and a link."""
data = await sleekplan("/docs/search", {"q": query, "user": sleekplan_user()})
results = [f"{item['title']}\n{item['url']}\n{item['text']}" for item in data["items"]]
return "\n\n".join(results) or "No results."
@mcp.tool(
title="Contact support",
annotations=ToolAnnotations(read_only_hint=False, destructive_hint=False, open_world_hint=False),
)
async def contact_support(
subject: Annotated[str, Field(min_length=1, max_length=150, description="One line that sums up the request.")],
message: Annotated[str, Field(min_length=1, max_length=10000, description="The user's message to the support team.")],
) -> str:
"""Sends the user's message to Acme's support team as a new conversation. Replies reach the user by email."""
user = sleekplan_user()
if user is None:
raise ToolError("Sign in to Acme to contact support.")
await sleekplan(
"/conversations",
{"from": "user", "source": "mcp", "user": user, "subject": subject, "text": message},
idempotency_key=str(uuid4()),
)
return "Sent to Acme support. The reply comes by email."Related
Authentication, error keys, request bodies and safe retries.
Every field and answer of the feedback intake.
Every field and answer of the docs search.
Start conversations for your users or from your team.
Connect your team's AI clients to your Sleekplan workspace.
