MCP: add configurable server profiles (public, internal)#2813
Merged
MCP: add configurable server profiles (public, internal)#2813
Conversation
- Introduce McpServerProfile and McpFeatureModule for compositional tool and instruction assembly - Public profile: all tools (search, documents, coherence, links, content types) - Internal profile: search and documents only, with intro for team processes, run books, architecture - Add MCP_SERVER_PROFILE env var, default "public" - Add XML tags (triggers, tool_guidance) for LLM-readable instructions - Add unit tests for instruction composition Made-with: Cursor
Add ToolNamePrefix, DocsDescription, and ExtraTriggers to McpServerProfile so each profile produces distinct tool names (e.g. public_docs_semantic_search, internal_docs_semantic_search) and profile-specific trigger bullets. Made-with: Cursor
theletterf
approved these changes
Feb 27, 2026
- Use StringBuilder in ReplaceToolPlaceholders instead of string concatenation in loop - Add DynamicallyAccessedMembers annotation to ToolType for AOT compatibility - Replace if/continue with LINQ Where filter in CreatePrefixedTools - Remove redundant ToString() calls in ToSnakeCase Made-with: Cursor
Add [property:] target to DynamicallyAccessedMembers on McpFeatureModule.ToolType so the annotation flows to the generated property (not just the constructor param). Avoid tuple/local extraction of ToolType in McpToolRegistration and McpServerProfile to preserve trim annotations through direct property access. Update container base image from 9.0-noble-chiseled-aot to 10.0-noble-chiseled to match the net10.0 target framework. Made-with: Cursor
src/api/Elastic.Documentation.Mcp.Remote/McpToolRegistration.cs
Dismissed
Show dismissed
Hide dismissed
The record positional parameter needs [DynamicallyAccessedMembers] on both the parameter (for constructor → backing field assignment) and the property (for callers accessing ToolType). Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
public_docs_semantic_search,internal_docs_semantic_search) and context-aware trigger bulletsWhy
Notes
MCP_SERVER_PROFILEenv var (default:public)WhenToUsetemplates use a{docs}placeholder replaced at composition time with the profile'sDocsDescription;ExtraTriggersadds profile-only bullets