Skip to main content
Glama
portel-dev

NCP - Natural Context Provider

by portel-dev
AI-POWERED-MCP-DISCOVERY.mdβ€’6.34 kB
# AI-Powered MCP Discovery ## 🎯 The Better Approach **You're absolutely right!** We don't need to wait for the registry. We can discover MCP servers in real-time: 1. **AI searches web** β†’ Finds potential MCP endpoints 2. **Validate URL** β†’ Test if it speaks MCP protocol 3. **Auto-discover** β†’ Find tools and auth requirements 4. **Import** β†’ Add to NCP automatically --- ## πŸ€– AI Discovery Workflow ### Step 1: Search for MCP Endpoints **User asks AI:** ``` "Search the web for public MCP servers that support HTTP or SSE" "Find MCP APIs that I can connect to remotely" "Are there any hosted MCP services available?" ``` **AI uses web search to find:** - Blog posts announcing MCP endpoints - GitHub repos with MCP server URLs - Company APIs with MCP support - Developer documentation mentioning MCP **Example findings:** ``` Found in article: "We're launching MCP support at https://api.example.com/mcp" Found in GitHub README: SSE endpoint available at https://mcp.service.com/sse Found in docs: Connect to our MCP at https://api.company.com/v1/mcp ``` ### Step 2: Validate Each URL **AI uses validation tool:** ```bash node tests/validate-mcp-url.js https://api.example.com/mcp ``` **Tool checks:** 1. βœ… Can connect to URL? 2. βœ… Responds to MCP protocol? 3. βœ… Returns tools list? 4. βœ… Valid server info? **If YES** β†’ It's a real MCP! **If NO** β†’ Skip it ### Step 3: Auto-Discover Configuration **For each valid MCP:** ``` 1. Detect auth type (bearer, oauth, apiKey, none) 2. List available tools 3. Get server capabilities 4. Generate import config ``` ### Step 4: Build Import CSV **AI generates:** ```csv name,url,description example-api,https://api.example.com/mcp,Example MCP Service company-mcp,https://api.company.com/v1/mcp,Company MCP API service-mcp,https://mcp.service.com/sse,Service MCP (SSE) ``` ### Step 5: Batch Import **User runs:** ```bash node tests/batch-import-mcps.js ai-discovered-mcps.csv --profile discovered ``` Or **AI imports directly** using internal tools! --- ## πŸš€ Complete AI Workflow Example ### User Conversation ``` User: "Find me some HTTP/SSE MCP servers I can connect to" AI: *Searches web* Found 3 potential MCP endpoints: 1. https://api.example.com/mcp (from blog post) 2. https://mcp.service.com/sse (from GitHub) 3. https://api.test.com/v1/mcp (from docs) Let me validate these... AI: *Runs validation tool on each* βœ… https://api.example.com/mcp β€’ Valid MCP server β€’ 5 tools available β€’ Requires: Bearer token βœ… https://mcp.service.com/sse β€’ Valid MCP server β€’ 8 tools available β€’ Requires: API key ❌ https://api.test.com/v1/mcp β€’ Not responding / Not an MCP server User: "Great! Add both valid ones to my profile" AI: *For each server* 1. Shows confirm_add_mcp prompt 2. User copies credentials to clipboard 3. AI imports using ncp:add βœ… Added example-api (bearer auth) βœ… Added service-mcp (api key auth) User: "List my MCPs" AI: Shows configured MCPs with URLs and auth types ``` --- ## πŸ› οΈ Tools Created ### 1. URL Validator (`validate-mcp-url.js`) **Usage:** ```bash node tests/validate-mcp-url.js <url> ``` **Features:** - Detects auth requirements - Attempts MCP protocol connection - Lists tools if successful - Reports capabilities - Suggests import config **Example:** ```bash $ node tests/validate-mcp-url.js https://api.example.com/mcp πŸ” Validating MCP URL URL: https://api.example.com/mcp Step 1: Detecting authentication requirements... πŸ” Requires: bearer Step 2: Attempting MCP protocol connection... βœ… Connected via MCP protocol Server Info: Name: example-mcp Version: 1.0.0 βœ… Found 5 tools: β€’ search_api Search the API database β€’ get_data Retrieve specific data ... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ πŸ“Š Validation Report βœ… VALID MCP SERVER Summary: URL: https://api.example.com/mcp Auth Type: bearer MCP Protocol: Supported Server: example-mcp v1.0.0 Tools: 5 ⚠️ Requires Authentication Auth Requirements: Type: bearer β€’ Bearer Token (required) Enter your API bearer token ``` ### 2. Batch Import (`batch-import-mcps.js`) Already created! Processes CSV of URLs with auto-discovery. ### 3. AI Integration **Internal MCP can:** 1. Call web search (if available) 2. Validate URLs using subprocess 3. Import directly using ncp:add --- ## 🎯 Why This is Better Than Waiting ### Registry Limitations - ❌ Only contains submitted servers - ❌ Requires manual submission process - ❌ May lag behind actual deployments - ❌ Not all companies will submit ### AI Discovery Advantages - βœ… Finds servers as they're announced - βœ… Discovers from blogs, docs, READMEs - βœ… Validates in real-time - βœ… No waiting for registry - βœ… Can find private/unlisted MCPs --- ## πŸ“‹ Immediate Action Plan ### For Users **Option 1: Manual Search + Validation** ```bash # 1. Find a potential MCP URL (web search) # 2. Validate it node tests/validate-mcp-url.js <url> # 3. If valid, add to CSV echo "name,url,description" > found-mcps.csv echo "my-mcp,<url>,Description" >> found-mcps.csv # 4. Import node tests/batch-import-mcps.js found-mcps.csv ``` **Option 2: Ask AI** ``` "Search for MCP servers and add valid ones to my profile" ``` AI will: 1. Search web 2. Validate URLs 3. Import automatically ### For Developers **If you're hosting an MCP:** 1. Announce your URL publicly (blog, docs, GitHub) 2. AI will find it 3. Users can discover and import automatically **No registry submission needed!** --- ## πŸ” Search Queries That Work AI can search for: - "MCP HTTP endpoint" - "MCP SSE server URL" - "Model Context Protocol API" - "MCP remote server" - "[Company] MCP support" - "MCP as a service" Then validate each URL found! --- ## ✨ The Future is Now **We don't need to wait for:** - ❌ Registry submissions - ❌ Official approvals - ❌ Standardized listings **We can discover MCPs:** - βœ… As they're deployed - βœ… From any source - βœ… Automatically - βœ… Right now **The unified discovery + AI search + URL validation = Complete MCP discovery system!** πŸš€

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/portel-dev/ncp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server