Skip to content

Commit aadcc9d

Browse files
DOC-1787 Set expectations with MCP server (#144)
* DOC-1787 * Make number of results configurable * Apply suggestions from code review Co-authored-by: Joyce Fee <[email protected]> --------- Co-authored-by: Joyce Fee <[email protected]>
1 parent eff3118 commit aadcc9d

File tree

2 files changed

+57
-6
lines changed

2 files changed

+57
-6
lines changed

home/modules/ROOT/pages/mcp-setup.adoc

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Add the following to your `.cursor/mcp.json` file:
2020
{
2121
"mcpServers": {
2222
"redpanda": {
23+
"type": "http",
2324
"url": "https://docs.redpanda.com/mcp"
2425
}
2526
}
@@ -98,6 +99,7 @@ Add this configuration:
9899
{
99100
"mcpServers": {
100101
"redpanda": {
102+
"type": "http",
101103
"url": "https://docs.redpanda.com/mcp"
102104
}
103105
}
@@ -110,6 +112,26 @@ For more details, see the https://support.anthropic.com/en/articles/9487310-desk
110112
--
111113
====
112114

115+
== Intended use
116+
117+
This public MCP endpoint is designed for:
118+
119+
* Evaluation and testing
120+
* IDE-based assistance and ad-hoc queries
121+
* Individual developer productivity
122+
123+
*Not suitable for:*
124+
125+
* High-volume automation or batch processing
126+
* Production services or runbooks
127+
* CI/CD pipelines or scheduled jobs
128+
129+
=== Technical specifications
130+
131+
* *Transport*: HTTP with Server-Sent Events (SSE) streaming support
132+
* *Rate limit*: 60 requests per 15-minute window per client
133+
* *Authentication*: None required for public endpoint
134+
113135
== Other AI tools
114136

115137
Any tool that supports MCP servers can connect using the following URL:
@@ -134,14 +156,23 @@ Once connected, you can ask context-aware questions about Redpanda from within y
134156

135157
== Usage limits
136158

137-
To ensure fair use and performance, the server enforces a rate limit of **60 questions per 15-minute window**.
159+
To ensure fair use and performance for all users, the public MCP endpoint enforces a rate limit of **60 requests per 15-minute window** per client.
160+
161+
This limit is suitable for:
138162

139-
If you exceed the limit, you receive an HTTP 429 response. Wait a few minutes before retrying.
163+
* Individual developer IDE usage
164+
* Ad-hoc documentation queries
165+
* Evaluation and testing
140166

141-
.Expected response
167+
If you exceed the limit, you receive an HTTP 429 response with rate limit headers. Wait until the reset time before retrying.
168+
169+
.Rate limit exceeded response
142170
[source,text]
143171
----
144172
HTTP 429 Too Many Requests
173+
RateLimit-Limit: 60
174+
RateLimit-Remaining: 0
175+
RateLimit-Reset: <timestamp>
145176
----
146177

147178
== Troubleshooting
@@ -160,6 +191,19 @@ HTTP 429 Too Many Requests
160191
* Try running **MCP: Reset Cached Tools** from the Command Palette.
161192
* Check the Output panel (*View* > *Output* > *MCP*) for error messages.
162193

194+
=== Configuration issues
195+
196+
* Ensure `"type": "http"` is specified in your configuration for HTTP-based MCP servers.
197+
* Some MCP clients may have issues with SSE streaming. If you experience connection problems, verify that your client supports HTTP-based MCP servers with Server-Sent Events (SSE).
198+
* Check that your client's Accept headers include both `application/json` and `text/event-stream`.
199+
200+
=== Rate limiting
201+
202+
If you're building automation or high-volume integrations and hitting rate limits frequently:
203+
204+
* The public endpoint's rate limits (60 requests per 15 minutes) are intentionally restrictive for fair use.
205+
* Consider implementing caching on your side to reduce duplicate queries.
206+
163207
=== Other issues
164208

165209
Check the https://github.com/modelcontextprotocol/servers[MCP GitHub repository^] for additional troubleshooting guidance or https://github.com/redpanda-data/docs-site/issues[report an issue^] with our documentation.

netlify/edge-functions/mcp.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const computeLimiterKey = (c) => {
6666
return `ua:${ua}|${accept}`
6767
}
6868

69-
const SERVER_VERSION = '0.2.0';
69+
const SERVER_VERSION = '0.3.0';
7070

7171
// Initialize MCP Server and register tools
7272
const server = new McpServer({
@@ -79,8 +79,11 @@ server.registerTool(
7979
'ask_redpanda_question',
8080
{
8181
title: 'Search Redpanda Sources',
82-
description: 'Search the official Redpanda documentation and return the most relevant sections from it for a user query. Each returned section includes the url and its actual content in markdown. Use this tool to for all queries that require Redpanda knowledge.',
83-
inputSchema: { question: z.string() },
82+
description: 'Search the official Redpanda documentation and return the most relevant sections from it for a user query. Each returned section includes the url and its actual content in markdown. Use this tool for all queries that require Redpanda knowledge. Results are ordered by relevance, with the most relevant result returned first. Returns up to 5 results by default to manage token usage. Use top_k parameter (1-15) to request more or fewer results.',
83+
inputSchema: {
84+
question: z.string(),
85+
top_k: z.number().int().min(1).max(15).optional().describe('Number of results to return (1-15). Defaults to 5 for optimal token usage.')
86+
},
8487
},
8588
async (args) => {
8689
const q = (args?.question ?? '').trim();
@@ -89,6 +92,9 @@ server.registerTool(
8992
content: [{ type: 'text', text: JSON.stringify({ error: 'missing_query', message: 'Provide a non-empty "question".' }) }]
9093
};
9194
}
95+
// Extract top_k parameter with default of 5, clamped to valid range
96+
const topK = Math.max(1, Math.min(15, args?.top_k ?? 5));
97+
9298
try {
9399
const response = await fetch(
94100
`${API_BASE}/query/v1/projects/${KAPA_PROJECT_ID}/retrieval/`,
@@ -101,6 +107,7 @@ server.registerTool(
101107
body: JSON.stringify({
102108
integration_id: KAPA_INTEGRATION_ID,
103109
query: q,
110+
top_k: topK,
104111
}),
105112
}
106113
);

0 commit comments

Comments
 (0)