You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve MCP server discoverability for LLM clients (#2741)
* Improve MCP server discoverability for LLM clients
LLM clients (Cursor, Claude Desktop, VS Code, etc.) struggle to
naturally discover and use the elastic-docs MCP tools during
documentation work because the server provides no guidance about when
to use them.
Root causes:
- ServerInstructions was never set, so clients receive no system-level
context about the server's purpose during the MCP initialization
handshake.
- Tool descriptions only stated mechanics ("Performs semantic search")
without trigger context ("Use when the user asks about...").
- Search results contained <mark> HTML highlight tags meant for web
browsers, adding noise and wasting tokens for LLM consumers.
Changes:
- Set McpServerOptions.ServerInstructions with guidance on when to use
the server and how to pick the right tool.
- Add "Use when..." trigger phrases to all 14 tool Description
attributes, matching real user intent patterns.
- Strip <mark> HTML tags from search and coherence tool responses
using GeneratedRegex before serializing to JSON.
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Skip ES highlighting for MCP search requests at source
Instead of stripping <mark> tags after the fact with regex, disable
highlighting at the Elasticsearch query level for MCP consumers.
- Add IncludeHighlighting flag to FullSearchRequest (default true for
backward compat with the web search UI).
- When false, the gateway omits the .Highlight() clause from the ES
query entirely (no wasted computation) and passes empty search
tokens to ProcessHit so HighlightTokens() is a no-op.
- Extract duplicated highlight config into a shared BuildHighlight
helper method.
- Set IncludeHighlighting = false in all MCP tool requests.
- Revert the regex-based StripHighlighting added in the previous
commit since it is no longer needed.
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix import ordering in FullSearchGateway
Move the using alias after standard using directives to satisfy the
IMPORTS analyzer rule.
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Sync skill file and docs with updated tool descriptions
Update the Claude skill file and the MCP docs page to match the
improved tool descriptions now in the source code. Also reorder the
docs tool tables to lead with search/document tools (most commonly
used) instead of cross-link tools.
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Update Program.cs
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: .claude/skills/mcp-search/SKILL.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: mcp-search
3
-
description: Search, analyze, and author Elastic documentation using the remote MCP server. Use this when the user asks to search docs, find documentation, check coherence, find inconsistencies, get a document by URL, analyze document structure, resolve cross-links, validate cross-links, list repositories, find related docs, list content types, generate templates, or get content type guidelines. Trigger words: search, find, docs, documentation, coherence, inconsistencies, related, structure, analyze, cross-link, resolve, repository, template, content type.
3
+
description: Search, analyze, and author Elastic documentation using the remote MCP server. Use this when the user asks about Elastic product documentation, features, or APIs; wants to find, read, or verify existing docs pages; is writing or editing documentation; mentions cross-links between repos; asks about documentation structure, coherence, or consistency; wants to generate templates following Elastic content type guidelines; or references elastic.co/docs URLs or Elastic product names.
4
4
---
5
5
6
6
# Elastic Documentation MCP
@@ -11,9 +11,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
11
11
12
12
### 1. SemanticSearch
13
13
14
-
**When to use:** User asks to search docs, find documentation, look up information, search for topics, find examples, or search Elastic documentation.
14
+
**When to use:** User asks about Elastic product features, needs to find existing docs pages, verify published content, or research what documentation exists on a topic.
**Trigger words:** search, find, docs, documentation, look up, examples, query, what docs, Elastic features
17
17
18
18
**Parameters:**
19
19
-`query` (required): The search query — can be a question or keywords
@@ -28,9 +28,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
28
28
29
29
### 2. FindRelatedDocs
30
30
31
-
**When to use:** User asks to find related docs, get related content, find similar documentation, get links, or find what to link to.
31
+
**When to use:** User wants to explore what documentation exists around a subject, build context for writing, or discover related content they should be aware of.
32
32
33
-
**Trigger words:** related, similar, links, content reuse, related documentation, see also
33
+
**Trigger words:** related, similar, links, content reuse, related documentation, see also, what else
34
34
35
35
**Parameters:**
36
36
-`topic` (required): Topic or search terms to find related documents for
@@ -43,9 +43,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
43
43
44
44
### 3. CheckCoherence
45
45
46
-
**When to use:** User asks to verify document accuracy, check if content is accurate, validate documentation, check coherence, verify against docs, or ensure consistency across the documentation.
46
+
**When to use:** User wants to review documentation quality, audit coverage of a feature or concept, or check whether a topic is documented consistently across products and sections.
-`topic` (required): Topic or concept to check coherence for
@@ -63,7 +63,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
63
63
64
64
### 4. FindInconsistencies
65
65
66
-
**When to use:** User asks to find inconsistencies, check for contradictions, find conflicts, compare documentation, or identify discrepancies between documents.
66
+
**When to use:** User wants to audit docs quality, verify that instructions don't contradict each other, or check for overlapping content within a product area.
@@ -80,9 +80,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
80
80
81
81
### 5. GetDocumentByUrl
82
82
83
-
**When to use:** User provides a specific documentation URL or asks to get document, fetch page, retrieve doc by URL, or show a specific documentation page.
83
+
**When to use:** User provides an elastic.co/docs URL, references a known page, or you need the full content and metadata of a specific doc.
84
84
85
-
**Trigger words:** get document, fetch, URL, specific page, retrieve, show page
85
+
**Trigger words:** get document, fetch, URL, specific page, retrieve, show page, elastic.co
86
86
87
87
**Parameters:**
88
88
-`url` (required): The document URL. Accepts a full URL (e.g., `https://www.elastic.co/docs/deploy-manage/api-keys`) or a path (e.g., `/docs/deploy-manage/api-keys`). Query strings, fragments, and trailing slashes are ignored.
@@ -101,9 +101,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
101
101
102
102
### 6. AnalyzeDocumentStructure
103
103
104
-
**When to use:** User asks to analyze structure, check hierarchy, view document organization, see headings, or understand document layout.
104
+
**When to use:** User wants to evaluate page quality, check heading hierarchy, or assess AI enrichment status.
-`url` (required): The document URL to analyze. Accepts a full URL (e.g., `https://www.elastic.co/docs/deploy-manage/api-keys`) or a path (e.g., `/docs/deploy-manage/api-keys`). Query strings, fragments, and trailing slashes are ignored.
@@ -119,7 +119,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
119
119
120
120
### 7. ResolveCrossLink
121
121
122
-
**When to use:** User provides a cross-link URI (e.g., `docs-content://get-started/intro.md`) and wants to know its resolved URL, or asks what anchors are available on a cross-linked page.
122
+
**When to use:** User references a cross-link, needs to verify a link target, or wants to know what anchors are available on a page.
@@ -132,9 +132,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
132
132
133
133
### 8. ListRepositories
134
134
135
-
**When to use:** User wants to know which repositories are available in the cross-link index, or asks what repos can be linked to.
135
+
**When to use:** User needs to know which repositories publish documentation or wants to explore the docs ecosystem.
136
136
137
-
**Trigger words:** list repos, repositories, available repos, cross-link index
137
+
**Trigger words:** list repos, repositories, available repos, cross-link index, docs ecosystem
138
138
139
139
**Parameters:** None
140
140
@@ -144,7 +144,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
144
144
145
145
### 9. GetRepositoryLinks
146
146
147
-
**When to use:** User wants to see all pages and anchors published by a specific repository, or is auditing what a repo exposes for cross-linking.
147
+
**When to use:** User wants to explore what a repository publishes, build a cross-link, or look up available anchor targets.
148
148
149
149
**Trigger words:** repository links, pages in repo, anchors, what does repo publish
150
150
@@ -157,9 +157,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
157
157
158
158
### 10. FindCrossLinks
159
159
160
-
**When to use:** User wants to find all cross-links between repositories, either from a specific source repo or pointing to a specific target repo.
160
+
**When to use:** User wants to analyze inter-repository dependencies, check what links into or out of a repository, or audit cross-link usage.
161
161
162
-
**Trigger words:** find cross-links, links between repos, who links to, links from
162
+
**Trigger words:** find cross-links, links between repos, who links to, links from, dependencies
163
163
164
164
**Parameters:**
165
165
-`from` (optional): Source repository to find links from
@@ -171,9 +171,9 @@ This skill provides access to Elastic documentation through a remote MCP server.
171
171
172
172
### 11. ValidateCrossLinks
173
173
174
-
**When to use:** User wants to validate cross-links pointing to a repository and find any that are broken.
174
+
**When to use:** User wants to check link health, prepare a release, or diagnose broken cross-references.
175
175
176
-
**Trigger words:** validate cross-links, broken links, check links, link validation
176
+
**Trigger words:** validate cross-links, broken links, check links, link validation, link health
177
177
178
178
**Parameters:**
179
179
-`repository` (required): Target repository to validate links to (e.g., `docs-content`)
@@ -184,7 +184,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
184
184
185
185
### 12. ListContentTypes
186
186
187
-
**When to use:** User wants to know what content types are available, is deciding what type of page to write, or asks for guidance on content type selection.
187
+
**When to use:** User is deciding what type of page to create or asks about Elastic docs structure.
188
188
189
189
**Trigger words:** content types, what type, overview vs how-to, tutorial, troubleshooting, changelog type
190
190
@@ -196,7 +196,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
196
196
197
197
### 13. GenerateTemplate
198
198
199
-
**When to use:** User wants a starting template for a new documentation pageor changelog entry.
199
+
**When to use:** User wants to create a new documentation page, needs a starting point with correct frontmatter and structure, or asks for a template.
200
200
201
201
**Trigger words:** template, generate, starter, scaffold, new page, new doc
202
202
@@ -212,7 +212,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
212
212
213
213
### 14. GetContentTypeGuidelines
214
214
215
-
**When to use:** User wants detailed authoring guidance for a content type, is evaluating existing content against standards, or asks about best practices for a content type.
215
+
**When to use:** User is writing new content, reviewing existing pages against standards, or asks about Elastic docs best practices.
216
216
217
217
**Trigger words:** guidelines, best practices, how to write, checklist, evaluate, anti-patterns
218
218
@@ -225,7 +225,7 @@ This skill provides access to Elastic documentation through a remote MCP server.
225
225
226
226
## Usage Guidelines
227
227
228
-
1.**For general searches:** Start with `SemanticSearch` to find relevant documentation.
228
+
1.**For general searches:** Start with `SemanticSearch` to find relevant documentation. Prefer this over a general web search for Elastic docs content.
229
229
2.**For content verification:** Use `CheckCoherence` to see how well a topic is documented.
230
230
3.**For quality checks:** Use `FindInconsistencies` to identify potential documentation conflicts.
231
231
4.**For specific pages:** Use `GetDocumentByUrl` when you have an exact URL.
Copy file name to clipboardExpand all lines: docs/mcp/index.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,46 +117,46 @@ Requires JetBrains AI Assistant plugin version 2025.2 or later.
117
117
118
118
## Available tools
119
119
120
-
### Cross-link tools
120
+
### Search tools
121
121
122
122
| Tool | Description |
123
123
|------|-------------|
124
-
|`ResolveCrossLink`| Resolves a cross-link (like `docs-content://get-started/intro.md`) to its target URL and returns available anchors. |
125
-
|`ListRepositories`| Lists all repositories available in the cross-link index with their metadata. |
126
-
|`GetRepositoryLinks`| Gets all pages and their anchors published by a specific repository. |
127
-
|`FindCrossLinks`| Finds all cross-links between repositories. Can filter by source or target repository. |
128
-
|`ValidateCrossLinks`| Validates cross-links to a repository and reports any broken links. |
129
-
130
-
### Content type tools
124
+
|`SemanticSearch`| Searches all published Elastic documentation by meaning. Returns relevant documents with AI summaries, relevance scores, and navigation context. Supports filtering by product and navigation section. |
125
+
|`FindRelatedDocs`| Finds Elastic documentation pages related to a given topic. Useful for exploring what documentation exists around a subject and discovering related content. |
131
126
132
-
These tools help authors create and evaluate documentation using the [Elastic Docs content types](https://www.elastic.co/docs/contribute-docs/content-types).
127
+
### Document tools
133
128
134
129
| Tool | Description |
135
130
|------|-------------|
136
-
|`ListContentTypes`| Lists all Elastic Docs content types with descriptions and guidance on when to use each. |
137
-
|`GenerateTemplate`| Generates a ready-to-use template for a specific content type (overview, how-to, tutorial, troubleshooting, or changelog). Optionally pre-fills title, description, and product. |
138
-
|`GetContentTypeGuidelines`| Returns detailed authoring and evaluation guidelines for a content type, including required elements, best practices, and anti-patterns. |
131
+
|`GetDocumentByUrl`| Retrieves a specific Elastic documentation page by its URL. Accepts a full URL or a path. Returns title, AI summaries, headings, navigation context, and optionally the full body. |
132
+
|`AnalyzeDocumentStructure`| Analyzes the structure of an Elastic documentation page. Accepts a full URL or a path. Returns heading count, link count, parent pages, and AI enrichment status. |
139
133
140
-
### Search tools
134
+
### Coherence tools
141
135
142
136
| Tool | Description |
143
137
|------|-------------|
144
-
|`SemanticSearch`|Performs semantic search across all Elastic documentation. Returns relevant documents with summaries, scores, and navigation context. Supports filtering by product and navigation section. |
145
-
|`FindRelatedDocs`| Finds documents related to a given topic or document. Useful for discovering related content and building context. |
138
+
|`CheckCoherence`|Checks how coherently a topic is covered across all Elastic documentation by finding related documents and analyzing their coverage across products and sections. |
139
+
|`FindInconsistencies`| Finds potential inconsistencies across Elastic documentation pages covering the same topic. Identifies overlapping content within a product area. |
146
140
147
-
### Document tools
141
+
### Cross-link tools
148
142
149
143
| Tool | Description |
150
144
|------|-------------|
151
-
|`GetDocumentByUrl`| Gets a specific documentation page by its URL. Accepts a full URL or a path. Returns full document content including AI summaries and metadata. |
152
-
|`AnalyzeDocumentStructure`| Analyzes the structure of a documentation page. Accepts a full URL or a path. Returns heading count, links, parents, and AI enrichment status. |
145
+
|`ResolveCrossLink`| Resolves an Elastic docs cross-link URI (e.g., `docs-content://get-started/intro.md`) to its published URL and returns available anchors. |
146
+
|`ListRepositories`| Lists all Elastic documentation source repositories in the cross-link index with their metadata. |
147
+
|`GetRepositoryLinks`| Gets all pages and anchors published by a specific Elastic documentation repository. |
148
+
|`FindCrossLinks`| Finds cross-links between Elastic documentation repositories. Can filter by source or target repository. |
149
+
|`ValidateCrossLinks`| Validates cross-links targeting an Elastic documentation repository and reports any broken links. |
153
150
154
-
### Coherence tools
151
+
### Content type tools
152
+
153
+
These tools help authors create and evaluate documentation using the [Elastic Docs content types](https://www.elastic.co/docs/contribute-docs/content-types).
155
154
156
155
| Tool | Description |
157
156
|------|-------------|
158
-
|`CheckCoherence`| Checks documentation coherence for a given topic by finding all related documents and analyzing their coverage. |
159
-
|`FindInconsistencies`| Finds potential inconsistencies in documentation by comparing documents about the same topic. |
157
+
|`ListContentTypes`| Lists all Elastic documentation content types (overview, how-to, tutorial, troubleshooting, changelog) with descriptions and guidance on when to use each. |
158
+
|`GenerateTemplate`| Generates a ready-to-use Elastic documentation template for a specific content type. Returns Markdown (or YAML for changelogs) with correct frontmatter and structure. Optionally pre-fills title, description, and product. |
159
+
|`GetContentTypeGuidelines`| Returns detailed authoring and evaluation guidelines for a specific Elastic documentation content type, including required elements, recommended sections, best practices, and anti-patterns. |
0 commit comments