Compare commits

...

5 Commits

Author SHA1 Message Date
github-actions[bot]
126a9ff406 Update version to v1.4.217 and commit 2025-06-26 23:09:56 +00:00
Kayvan Sylvan
e906425138 Merge pull request #1546 from ksylvan/0626-fix-yt-in-web-interface
New YouTube Transcript Endpoint Added to REST API
2025-06-26 16:08:23 -07:00
Daniel Miessler
df4a560302 Add extract_mcp_servers pattern
New pattern to extract mentions of MCP (Model Context Protocol) servers from content. Identifies server names, features, capabilities, and usage examples.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26 11:39:21 -07:00
Kayvan Sylvan
34cf669bd4 chore: fix endpoint calls from frontend 2025-06-26 01:37:53 -07:00
Kayvan Sylvan
0dbe1bbb4e feat: add dedicated YouTube transcript API endpoint
## CHANGES

- Add new YouTube handler for transcript requests
- Create `/youtube/transcript` POST endpoint route
- Add request/response types for YouTube API
- Support language and timestamp options
- Update frontend to use new endpoint
- Remove chat endpoint dependency for transcripts
- Validate video vs playlist URLs properly
2025-06-26 01:21:27 -07:00
6 changed files with 141 additions and 6 deletions

View File

@@ -1 +1 @@
"1.4.216"
"1.4.217"

View File

@@ -0,0 +1,64 @@
# IDENTITY and PURPOSE
You are an expert at analyzing content related to MCP (Model Context Protocol) servers. You excel at identifying and extracting mentions of MCP servers, their features, capabilities, integrations, and usage patterns.
Take a step back and think step-by-step about how to achieve the best results for extracting MCP server information.
# STEPS
- Read and analyze the entire content carefully
- Identify all mentions of MCP servers, including:
- Specific MCP server names
- Server capabilities and features
- Integration details
- Configuration examples
- Use cases and applications
- Installation or setup instructions
- API endpoints or methods exposed
- Any limitations or requirements
# OUTPUT SECTIONS
- Output a summary of all MCP servers mentioned with the following sections:
## SERVERS FOUND
- List each MCP server found with a 15-word description
- Include the server name and its primary purpose
- Use bullet points for each server
## SERVER DETAILS
For each server found, provide:
- **Server Name**: The official name
- **Purpose**: Main functionality in 25 words or less
- **Key Features**: Up to 5 main features as bullet points
- **Integration**: How it integrates with systems (if mentioned)
- **Configuration**: Any configuration details mentioned
- **Requirements**: Dependencies or requirements (if specified)
## USAGE EXAMPLES
- Extract any code snippets or usage examples
- Include configuration files or setup instructions
- Present each example with context
## INSIGHTS
- Provide 3-5 insights about the MCP servers mentioned
- Focus on patterns, trends, or notable characteristics
- Each insight should be a 20-word bullet point
# OUTPUT INSTRUCTIONS
- Output in clean, readable Markdown
- Use proper heading hierarchy
- Include code blocks with appropriate language tags
- Do not include warnings or notes about the content
- If no MCP servers are found, simply state "No MCP servers mentioned in the content"
- Ensure all server names are accurately captured
- Preserve technical details and specifications
# INPUT:
INPUT:

View File

@@ -26,6 +26,7 @@ func Serve(registry *core.PluginRegistry, address string, apiKey string) (err er
NewContextsHandler(r, fabricDb.Contexts)
NewSessionsHandler(r, fabricDb.Sessions)
NewChatHandler(r, registry, fabricDb)
NewYouTubeHandler(r, registry)
NewConfigHandler(r, fabricDb)
NewModelsHandler(r, registry.VendorManager)
NewStrategiesHandler(r)

70
restapi/youtube.go Normal file
View File

@@ -0,0 +1,70 @@
package restapi
import (
"net/http"
"github.com/danielmiessler/fabric/core"
"github.com/danielmiessler/fabric/plugins/tools/youtube"
"github.com/gin-gonic/gin"
)
type YouTubeHandler struct {
yt *youtube.YouTube
}
type YouTubeRequest struct {
URL string `json:"url"`
Language string `json:"language"`
Timestamps bool `json:"timestamps"`
}
type YouTubeResponse struct {
Transcript string `json:"transcript"`
Title string `json:"title"`
}
func NewYouTubeHandler(r *gin.Engine, registry *core.PluginRegistry) *YouTubeHandler {
handler := &YouTubeHandler{yt: registry.YouTube}
r.POST("/youtube/transcript", handler.Transcript)
return handler
}
func (h *YouTubeHandler) Transcript(c *gin.Context) {
var req YouTubeRequest
if err := c.BindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": "invalid request"})
return
}
if req.URL == "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "url is required"})
return
}
language := req.Language
if language == "" {
language = "en"
}
var videoID, playlistID string
var err error
if videoID, playlistID, err = h.yt.GetVideoOrPlaylistId(req.URL); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if videoID == "" && playlistID != "" {
c.JSON(http.StatusBadRequest, gin.H{"error": "URL is a playlist, not a video"})
return
}
var transcript string
if req.Timestamps {
transcript, err = h.yt.GrabTranscriptWithTimestamps(videoID, language)
} else {
transcript, err = h.yt.GrabTranscript(videoID, language)
}
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
return
}
c.JSON(http.StatusOK, YouTubeResponse{Transcript: transcript, Title: videoID})
}

View File

@@ -1,3 +1,3 @@
package main
var version = "v1.4.216"
var version = "v1.4.217"

View File

@@ -1,5 +1,5 @@
import { get } from 'svelte/store';
import { languageStore } from '$lib/store/language-store';
import { get } from 'svelte/store';
export interface TranscriptResponse {
transcript: string;
@@ -18,18 +18,18 @@ export async function getTranscript(url: string): Promise<TranscriptResponse> {
console.log('\n=== YouTube Transcript Service Start ===');
console.log('1. Request details:', {
url,
endpoint: '/chat',
endpoint: '/api/youtube/transcript',
method: 'POST',
isYouTubeURL: url.includes('youtube.com') || url.includes('youtu.be'),
originalLanguage
});
const response = await fetch('/chat', {
const response = await fetch('/api/youtube/transcript', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
body: JSON.stringify({
url,
language: originalLanguage // Pass original language to server
})