Real-Time YouTube Script Generator MCP Server
This server provides real-time web search and AI-powered short video script generation. Use get_latest_info_mcp(query) to fetch a Tavily-powered summary of the latest information on any topic. Use get_video_script_mcp(query) to generate a production-ready YouTube Shorts/Reels script with hooks, visual cues, spoken voiceover, and calls-to-action, all based on live web data.
Provides AI-powered script generation for short-form videos, using Gemini LLM to synthesize real-time search data into production-ready YouTube Shorts/Instagram Reels scripts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Real-Time YouTube Script Generator MCP ServerWrite a short script about today's top trending tech news"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š¬ Real-Time YouTube Script Generator & MCP Server
š Live Demo: Real-Time YouTube Script Generator

An AI-powered application that retrieves real-time web information using Tavily Search and converts it into high-retention, production-ready short video scripts (YouTube Shorts / Instagram Reels) using Gemini LLM.
The project features both a Streamlit Web App interface and a FastMCP (Model Context Protocol) Server for seamless integration with AI assistants (Claude, Cursor, etc.).
⨠Features
š Real-Time Web Search: Integrates Tavily API for fetching up-to-date web data.
š AI Summarization: Automatically synthesizes search snippets into concise, structured summaries.
š Production-Ready Script Generation: Formats context into short-video scripts complete with visual cues, verbal hooks, and call-to-actions.
š» Interactive Streamlit Web UI: Simple web browser interface to search, preview, and download scripts as
.txt.š Model Context Protocol (FastMCP): Exposes search and script generation tools as standard MCP endpoints for external AI clients.
Related MCP server: video-research-mcp
š§ Key Learnings & Important Takeaways
Real-Time Grounding Eliminates Hallucination:
Standard LLMs suffer from knowledge cutoff dates. Combining Tavily real-time web search with Gemini allows the generator to craft accurate scripts on breaking news and trending topics.
Fault-Tolerant Fallback Architecture:
If the LLM summarization call fails (rate limits, network glitches), the pipeline gracefully falls back to displaying raw web search snippets, ensuring the user never receives a blank page or error crash.
Decoupled Architecture with FastMCP:
By separating the core utility functions (
app.py) from the transport interface (mcp_server.py), the exact same business logic powers both an interactive web application (Streamlit) and external IDE/Assistant workflows (Claude Desktop, Cursor).
Structured Short-Form Script Prompting:
Short-video scripts (Shorts/Reels) require immediate engagement. Using structured prompt directives (Visual Cues
[...]vs. Spoken Words(...)and Hook ā Frame ā Payload ā CTA layout) produces production-grade output.
Multi-Provider Compatibility:
Utilizing standard client abstractions (such as the OpenAI SDK with custom
base_urlfor AICredits or official Google Gemini SDK) allows switching between underlying model backends effortlessly.
š ļø Project Structure
āāā app.py # Streamlit web application & core logic (Tavily + LLM)
āāā mcp_server.py # FastMCP server exposing tool endpoints
āāā assests/ # Project diagrams & images
ā āāā 3242.png
āāā pyproject.toml # Project configuration & dependencies
āāā .env # API keys configuration (not committed)
āāā README.md # Project documentationš Environment Setup
Create a .env file in the root directory:
AICREDITS_API_KEY=your_aicredits_or_openai_key
TAVILY_API_KEY=your_tavily_api_key
GEMINI_API_KEY=your_google_gemini_api_keyš¦ Installation
Using uv (recommended):
uv syncš Usage
1. Run the Streamlit Web Application
To launch the interactive web interface:
uv run streamlit run app.pyOpen your browser at http://localhost:8501.
2. Test/Dev MCP Server with FastMCP Inspector
To test the MCP tools (get_latest_info_mcp and get_video_script_mcp) in an interactive browser UI:
uv run mcp dev mcp_server.py3. Connect MCP Server to Claude / Cursor
Add the server definition to your MCP client configuration (e.g. claude_desktop_config.json):
{
"mcpServers": {
"youtube-script-generator": {
"command": "uv",
"args": ["run", "python", "C:/Users/DELL/Desktop/New folder/mcp_server.py"]
}
}
}š ļø MCP Tools Offered
Tool Name | Description |
| Performs a real-time web search and returns an AI summary. |
| Fetches real-time web search data and generates a production-ready script. |

š» API Code Examples, Parameters & Incoming Result Formats
Below is complete reference code to interact with all the APIs integrated into this project, including parameter definitions and sample response payloads.
1. Tavily Search API (tavily-python)
Used to retrieve real-time web search results and snippets.
Code Example
import os
from tavily import TavilyClient
# Initialize client
tavily_client = TavilyClient(api_key=os.getenv("TAVILY_API_KEY"))
# Execute web search
response = tavily_client.search(
query="Latest developments in AI agents",
max_results=3,
topic="general",
search_depth="advanced"
)
print("Search Response:", response)Input Parameters
Parameter | Type | Description |
|
| Search topic or query string. |
|
| Maximum number of search results to return (e.g., |
|
| Category of search ( |
|
| Level of search detail ( |
Incoming Result Format (JSON Response)
{
"query": "Latest developments in AI agents",
"follow_up_questions": null,
"answer": null,
"images": [],
"results": [
{
"title": "Autonomous AI Agents in 2026: Trends & Breakthroughs",
"url": "https://example.com/ai-agents-2026",
"content": "AI agents are transforming software engineering with multi-agent orchestration and tool calling capabilities...",
"score": 0.9821,
"raw_content": null
},
{
"title": "Open Source AI Agent Frameworks Overview",
"url": "https://example.com/agent-frameworks",
"content": "A comprehensive review of modern agent frameworks built for fast model context protocol (MCP) integration...",
"score": 0.9543,
"raw_content": null
}
],
"response_time": 0.84
}2. AICredits API (OpenAI Client Interface)
Used in app.py to route model requests through OpenAI-compatible proxy endpoints.
Code Example
import os
from openai import OpenAI
# Initialize client pointing to AICredits endpoint
client = OpenAI(
base_url="https://api.aicredits.in/v1",
api_key=os.getenv("AICREDITS_API_KEY")
)
# Request completion
completion = client.chat.completions.create(
model="gemini-2.0-flash-lite-001",
messages=[
{"role": "user", "content": "Summarize key features of quantum computing."}
],
temperature=0.3
)
print(completion.choices[0].message.content)Input Parameters
Parameter | Type | Description |
|
| Model identifier (e.g., |
|
| Chat history array of `{"role": "user" |
|
| Sampling randomness ( |
Incoming Result Format (ChatCompletion JSON Object)
{
"id": "chatcmpl-8x92a01bf982",
"object": "chat.completion",
"created": 1772500000,
"model": "gemini-2.0-flash-lite-001",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "Key features of quantum computing include:\n- **Superposition**: Qubits exist in multiple states simultaneously.\n- **Entanglement**: Interconnected qubit states enable exponentially faster calculations.\n- **Quantum Interference**: Amplifies correct paths to solve complex optimization problems."
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 42,
"completion_tokens": 88,
"total_tokens": 130
}
}3. Official Google Gemini API (google-genai SDK)
Used to call Gemini models directly via Google's official client library (google-genai).
Code Example
import os
from google import genai
from google.genai import types
# Initialize official Gemini client
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))
# Generate content call
response = client.models.generate_content(
model="gemini-2.0-flash",
contents="Write a 30-second YouTube Short hook on space exploration.",
config=types.GenerateContentConfig(
temperature=0.7,
max_output_tokens=500
)
)
print("Generated Output:", response.text)Input Parameters
Parameter | Type | Description |
|
| Model selection ( |
|
| Text prompt or multi-modal input. |
|
| Generation settings ( |
Incoming Result Format (GenerateContentResponse Object)
{
"candidates": [
{
"content": {
"parts": [
{
"text": "[Visual Cue: Fast zoom onto Mars surface]\n(Voiceover): Did you know we just found proof of liquid water under the Martian crust?"
}
],
"role": "model"
},
"finish_reason": "STOP",
"index": 0,
"safety_ratings": []
}
],
"usage_metadata": {
"prompt_token_count": 28,
"candidates_token_count": 45,
"total_token_count": 73
}
}4. Core Internal Functions (app.py Interface)
Core helper functions combining real-time web retrieval and AI script generation.
Code Example
from app import get_realtime_info, generate_video_script
query = "Latest SpaceX Launch"
# Step 1: Get real-time summary & raw search backup
summary_text, raw_search_backup = get_realtime_info(query)
# Step 2: Generate production script using context
script = generate_video_script(summary_text or raw_search_backup)
print("--- SUMMARY ---")
print(summary_text)
print("\n--- SCRIPT ---")
print(script)Input & Output Signatures
def get_realtime_info(query: str) -> tuple[str, str]:
"""
Inputs:
query (str): The search topic or keyword string.
Returns:
tuple[str, str]: (llm_summary_text, raw_source_info_markdown)
"""
def generate_video_script(info_text: str) -> str:
"""
Inputs:
info_text (str): Summarized or raw information context.
Returns:
str: Production-ready YouTube Short / Reel script.
"""Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceThis MCP fetches trending data from platforms like YouTube, TikTok, and Instagram Reels using various scraping and API techniques. It's designed to run under FastMCP and exposes tools that can be consumed via a local CLI or claude.Last updated22
- AlicenseAqualityBmaintenance45-tool MCP server for video analysis, deep research, content extraction, web search, and Weaviate knowledge storage. Powered by Gemini 3.1 Pro.Last updated342622MIT

AITuber MCP Serverofficial
AlicenseAqualityBmaintenanceCreate AI-powered videos from any MCP-compatible client. Generate videos with AI narration, visuals, and synced captions for short-form and long-form content.Last updated22944MIT- Flicense-qualityCmaintenanceMCP server for generating and managing YouTube video scripts with human-in-the-loop approval.Last updated
Related MCP Connectors
šÆ The fastest YouTube transcript + YouTube search MCP for AI agents. Try for free.
Hosted MCP with 91 agent tools: X, domains, SEO, Maps, Trends, Search, YouTube, TikTok, and more.
MCP server for Google Veo AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Shivanshvyas1729/Real-Time-YouTube-Script-Generator-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server