-
Notifications
You must be signed in to change notification settings - Fork 12
MCP Sampling
Version: 1.14.0+ Status: ✅ Production Ready Feature: AI-Powered Intelligence via MCP Sampling
MCP Sampling is an advanced feature that allows the Cisco Support MCP Server to leverage AI/LLM capabilities without requiring server-side API keys. The client (like Claude Desktop) handles all LLM interactions, maintaining full control over model selection and costs.
- 🤖 AI-Powered Intelligence - Natural language processing and analysis
- 🔒 Zero Server Keys - Server never needs LLM API credentials
- 🎛️ Client Control - Client chooses models and manages costs
- 📊 Smart Analysis - Upgrade risk assessment, bug categorization, and more
- 🔄 Graceful Fallback - Works even when sampling is unavailable
sequenceDiagram
participant User
participant MCP Client
participant MCP Server
participant LLM
User->>MCP Client: "What's the product ID for Catalyst 9200?"
MCP Client->>MCP Server: resolve_product_name tool call
MCP Server->>MCP Client: createMessage sampling request
MCP Client->>User: Show approval UI (optional)
MCP Client->>LLM: Process with user's model
LLM->>MCP Client: "C9200-24P"
MCP Client->>MCP Server: Sampling response
MCP Server->>MCP Client: Tool result with product ID
MCP Client->>User: "The product ID is C9200-24P"
Convert natural language product descriptions to Cisco product IDs.
Input:
{
"product_description": "Catalyst 9200 24-port switch with PoE"
}Output:
- Product ID:
C9200-24P - Usage suggestions for next steps
Use Case: When users describe products conversationally instead of using technical IDs.
Example Queries:
- "What's the product ID for a Catalyst 9200 24-port switch?"
- "Find the PID for an ISR 4000 series router"
- "Convert 'ASA firewall 5516' to a product ID"
AI-powered bug analysis and categorization.
Input:
{
"bug_description": "Router crashes during high CPU load with memory leak"
}Output:
{
"severity": "high",
"impact": "crash-memory-leak",
"category": "routing"
}Use Case: Quick triage and classification of unfamiliar bugs.
Example Queries:
- "Categorize this bug: Router crashes during firmware upgrade"
- "Analyze this issue: Memory leak in CallManager 12.5"
- "What severity is this: Intermittent network disconnections"
Comprehensive AI analysis of software upgrade risks.
Input:
{
"product_id": "C9300-24P",
"current_version": "17.9.1",
"target_version": "17.12.3"
}Output:
- Risk level assessment (Low/Medium/High/Critical)
- Key issues to be aware of
- Recommended actions
- Specific prerequisites and precautions
Use Case: Planning software upgrades with detailed risk analysis.
Example Queries:
- "Analyze upgrade risks from IOS-XE 17.9.1 to 17.12.3"
- "Should I upgrade my Catalyst 9300 from 16.12 to 17.6?"
- "What are the risks of upgrading CallManager from 12.5 to 14.0?"
Generate natural language summaries of bug search results.
Input:
{
"bug_ids": "CSCvi12345,CSCvi12346,CSCvi12347",
"search_context": "ISR4431 upgrade planning"
}Output:
- Overall findings (bug count, severity distribution)
- Critical issues highlighted
- Key recommendations
- Human-readable summary
Use Case: Executive summaries, reports, and quick overviews.
Example Queries:
- "Summarize these bugs for my CallManager upgrade"
- "Give me an executive summary of critical bugs for C9300"
- "Create a report summary for these 10 bug IDs"
Parse natural language queries into structured search parameters.
Input:
{
"natural_query": "Show me critical bugs for Catalyst 9200 running 17.9.1"
}Output:
{
"productSeries": "Cisco Catalyst 9200 Series",
"version": "17.9.1",
"severity": 1,
"keywords": ["critical", "bugs"]
}Use Case: Conversational bug searches with automatic parameter extraction.
Example Queries:
- "Parse this: Find high-severity bugs for ISR4431 version 17.6"
- "Extract search parameters from: Show me open bugs in CallManager 14.0"
- "Understand query: Critical security issues in ASA 9.17"
Add to claude_desktop_config.json:
{
"mcpServers": {
"cisco-support": {
"command": "npx",
"args": ["mcp-cisco-support"],
"env": {
"CISCO_CLIENT_ID": "your_client_id",
"CISCO_CLIENT_SECRET": "your_secret",
"SUPPORT_API": "bug,sampling"
}
}
}
}# Sampling tools only (5 tools)
SUPPORT_API=sampling
# Sampling + Bug API (19 tools)
SUPPORT_API=bug,sampling
# All stable APIs + Sampling (50 tools)
SUPPORT_API=all,samplingSampling uses an abstraction layer instead of specific model names:
- intelligencePriority - How important are advanced capabilities
- speedPriority - How important is low latency
- costPriority - How important is minimizing cost
Product Name Resolution:
{
intelligencePriority: 0.5, // Moderate intelligence
speedPriority: 0.8, // Fast response important
costPriority: 0.7, // Keep costs low
temperature: 0.1 // Deterministic
}Bug Categorization:
{
intelligencePriority: 0.8, // Good analysis needed
speedPriority: 0.5, // Balanced
costPriority: 0.5, // Balanced
temperature: 0.2 // Mostly deterministic
}Upgrade Risk Analysis:
{
intelligencePriority: 0.9, // Thorough analysis critical
speedPriority: 0.3, // Can take time
costPriority: 0.3, // Quality over cost
temperature: 0.3 // Some creativity ok
}- MCP SDK: v1.20.2 or later
- Protocol: MCP 2025-06-18 specification
-
Capability: Must declare
samplingin capabilities during initialization
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {
"sampling": {}
},
"clientInfo": {
"name": "Claude Desktop",
"version": "1.0.0"
}
}
}- ✅ No Server API Keys - Server never requires or stores LLM API keys
- ✅ Client Control - Client maintains full control over model access
- ✅ Human-in-Loop - Clients should provide approval UI for sampling requests
- ✅ Audit Trail - All sampling requests logged for transparency
- ✅ Graceful Degradation - Tools provide helpful errors when sampling unavailable
- ✅ Review sampling requests before approval (client-side)
- ✅ Set appropriate model preferences for each use case
- ✅ Monitor sampling usage and costs (client-side)
- ✅ Use lower intelligence priority for simple tasks
- ✅ Implement rate limiting (client-side)
If the client doesn't support sampling, tools return helpful error messages:
{
"error": "MCP Sampling Not Available",
"message": "This tool requires MCP sampling capability which is not available in your current client.",
"alternatives": [
"Use basic bug search tools instead",
"Upgrade to a client that supports MCP sampling",
"Refer to documentation for manual analysis"
],
"documentation": "https://github.com/sieteunoseis/mcp-cisco-support/wiki/MCP-Sampling"
}- Server Load: Minimal (sampling happens client-side)
- Latency: Depends on client's LLM provider
- Cost: User controls via model preferences
- Fallback: Standard tools still available
Located in src/utils/sampling.ts:
export async function requestSampling(
server: Server,
prompt: string,
systemPrompt?: string,
options?: {
maxTokens?: number;
temperature?: number;
modelPreferences?: ModelPreferences;
}
): Promise<string>Located in src/apis/sampling-tools.ts:
export const samplingTools: McpTool[] = [
{
name: 'resolve_product_name',
description: 'Convert natural language product descriptions to Cisco product IDs using AI',
inputSchema: {
type: 'object',
properties: {
product_description: {
type: 'string',
description: 'Natural language description of the product'
}
},
required: ['product_description']
}
},
// ... other tools
];# Start server with sampling enabled
SUPPORT_API=sampling npm start
# In Claude Desktop, try:
# "What's the product ID for a Catalyst 9200 switch?"- Client sends tool call to server
- Server requests sampling from client
- Client shows approval UI (optional)
- Client processes with LLM
- Server receives response and returns result
Cause: Client doesn't support MCP sampling
Solutions:
- Use Claude Desktop v1.0+ which supports sampling
- Check client MCP SDK version (needs v1.20.2+)
- Verify
capabilities.samplingis declared during init - Use alternative non-AI tools
Cause: LLM processing taking too long or client not responding
Solutions:
- Check client LLM provider status
- Reduce
maxTokensin model preferences - Increase
speedPriorityfor faster models - Check network connectivity
Cause: Model returning unexpected format or data
Solutions:
- Review system prompts in
src/utils/sampling.ts - Adjust
temperature(lower = more deterministic) - Increase
intelligencePriorityfor better quality - Check input data format and clarity
- MCP Specification - Sampling
- Available Tools - All 56 MCP tools
- Development Guide - Adding new sampling tools
- Testing Framework - Testing sampling features
| Version | Date | Changes |
|---|---|---|
| 1.14.0 | Oct 2025 | Initial sampling implementation with 5 AI-powered tools |
| 1.14.1 | Oct 2025 | Improved error messages and fallback behavior |
| 1.15.0 | TBD | Additional sampling tools (planned) |
- Bug Resolution Predictor - Predict if/when a bug will be fixed
- Product Compatibility Checker - AI-powered compatibility analysis
- Release Notes Summarizer - Natural language release note summaries
- Incident Correlation - Find related bugs across products
- Configuration Validator - AI-powered config validation
- Caching for common queries
- Progressive sampling (try simple first, escalate if needed)
- Streaming support for long responses
- Specialized prompts per product family
- Multi-turn conversation support
Last Updated: October 2025 | Version: 1.14.0+ | Feature Status: Production Ready