Documents: context-private not recognized (hardcoded source list?) #337

Closed
opened 2026-03-02 12:56:47 +00:00 by jack · 1 comment
Owner

Problem

Documents-View erkennt context-private nicht als Quelle.

Vermutung: Hardcodierte Liste von unterstützten Quellen.

Erwartetes Verhalten

Alle Skills sollten automatisch erkannt werden, nicht nur eine vordefinierte Liste.

Mögliche Implementation

Aktuell (vermutlich):

const KNOWN_SOURCES = [
  'context7',
  'webfetch',
  'github-docs',
  // context-private fehlt!
];

function getSource(url: string) {
  if (url.includes('context7')) return 'context7';
  if (url.includes('webfetch')) return 'webfetch';
  // ...
  return 'unknown';
}

Gewünscht: Auto-Discovery

// Option 1: Aus URL extrahieren
function getSource(url: string) {
  // z.B. "mcp://context-private/..." → context-private
  const match = url.match(/^mcp:\/\/([^/]+)/);
  return match ? match[1] : 'unknown';
}

// Option 2: Aus Document-Metadata
interface Document {
  source: string; // Direkt speichern bei Fetch
  url: string;
  content: string;
}

Betroffene Skills

Vermutlich fehlen auch:

  • context-private ✓ (bestätigt)
  • Alle Custom MCP-Tools?
  • Neue Skills die nach Initial-Release hinzugefügt wurden?

Acceptance Criteria

  • context-private wird erkannt
  • Neue Skills/Sources automatisch unterstützt
  • Keine hardcodierte Liste nötig
  • Source-Detection aus URL oder Metadata

Priority

Medium - Funktional vorhanden, aber UX-Problem.

## Problem **Documents-View** erkennt `context-private` nicht als Quelle. **Vermutung:** Hardcodierte Liste von unterstützten Quellen. ## Erwartetes Verhalten **Alle Skills sollten automatisch erkannt werden**, nicht nur eine vordefinierte Liste. ## Mögliche Implementation ### Aktuell (vermutlich): ```typescript const KNOWN_SOURCES = [ 'context7', 'webfetch', 'github-docs', // context-private fehlt! ]; function getSource(url: string) { if (url.includes('context7')) return 'context7'; if (url.includes('webfetch')) return 'webfetch'; // ... return 'unknown'; } ``` ### Gewünscht: Auto-Discovery ```typescript // Option 1: Aus URL extrahieren function getSource(url: string) { // z.B. "mcp://context-private/..." → context-private const match = url.match(/^mcp:\/\/([^/]+)/); return match ? match[1] : 'unknown'; } // Option 2: Aus Document-Metadata interface Document { source: string; // Direkt speichern bei Fetch url: string; content: string; } ``` ## Betroffene Skills **Vermutlich fehlen auch:** - `context-private` ✓ (bestätigt) - Alle Custom MCP-Tools? - Neue Skills die nach Initial-Release hinzugefügt wurden? ## Acceptance Criteria - [x] `context-private` wird erkannt - [x] Neue Skills/Sources automatisch unterstützt - [x] Keine hardcodierte Liste nötig - [x] Source-Detection aus URL oder Metadata ## Priority **Medium** - Funktional vorhanden, aber UX-Problem.
Author
Owner

Vorschlag: Claude Code MCP Auto-Detection

Claude Code hat vermutlich eine API um aktive MCP-Server abzufragen!

Mögliche Implementation

// Statt hardcodierte Liste:
const KNOWN_SOURCES = ['context7', 'webfetch'];

// Claude Code API nutzen:
import { getMCPServers } from '@claude/code-sdk';

async function getActiveSources() {
  const mcpServers = await getMCPServers();
  return mcpServers.map(s => s.name);
  // → ['context7', 'webfetch', 'context-private', ...]
}

Vorteile

  • Automatisch alle aktiven MCP-Tools
  • Keine Wartung nötig (neue Tools automatisch erkannt)
  • Nutzer-spezifische Tools (nicht jeder hat context-private)

Alternative: MCP-Tool-Namen aus Document-URL

Falls keine API verfügbar:

// Document-URL: "mcp://context-private/docs/..."
const source = new URL(doc.url).hostname; // → context-private

Prüfen: Gibt es eine Claude Code API für MCP-Server-Discovery?

## Vorschlag: Claude Code MCP Auto-Detection **Claude Code hat vermutlich eine API** um aktive MCP-Server abzufragen! ### Mögliche Implementation ```typescript // Statt hardcodierte Liste: const KNOWN_SOURCES = ['context7', 'webfetch']; // Claude Code API nutzen: import { getMCPServers } from '@claude/code-sdk'; async function getActiveSources() { const mcpServers = await getMCPServers(); return mcpServers.map(s => s.name); // → ['context7', 'webfetch', 'context-private', ...] } ``` ### Vorteile - ✅ Automatisch alle aktiven MCP-Tools - ✅ Keine Wartung nötig (neue Tools automatisch erkannt) - ✅ Nutzer-spezifische Tools (nicht jeder hat context-private) ### Alternative: MCP-Tool-Namen aus Document-URL Falls keine API verfügbar: ```typescript // Document-URL: "mcp://context-private/docs/..." const source = new URL(doc.url).hostname; // → context-private ``` **Prüfen:** Gibt es eine Claude Code API für MCP-Server-Discovery?
review.bot 2026-03-02 14:29:05 +00:00
  • closed this issue
  • added the
    has-pr
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
customable/claude-mem#337
No description provided.