### Updated Epic 4 Documentation - Enhanced Story 4.3: Multi-video Analysis with Multi-Agent System - Three perspective agents (Technical, Business, User) - Synthesis agent for unified summaries - Integration with existing AI ecosystem - Increased effort from 28 to 40 hours - Enhanced Story 4.4: Custom Models & Enhanced Markdown Export - Executive summary generation (2-3 paragraphs) - Timestamped sections with [HH:MM:SS] format - Enhanced markdown structure with table of contents - Increased effort from 24 to 32 hours - Enhanced Story 4.6: RAG-Powered Video Chat with ChromaDB - ChromaDB vector database integration - RAG implementation using existing test patterns - Chat interface with timestamp source references - DeepSeek integration for AI responses ### Epic Effort Updates - Total Epic 4 effort: 126 → 146 hours - Remaining work: 72 → 92 hours - Implementation timeline extended to 4-5 weeks 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| README.md | ||
| __init__.py | ||
| example.py | ||
| mcp_mixin.py | ||
README.md
from mcp.types import ToolAnnotations
MCP Mixin
This module provides the MCPMixin base class and associated decorators (@mcp_tool, @mcp_resource, @mcp_prompt).
It allows developers to easily define classes whose methods can be registered as tools, resources, or prompts with a FastMCP server instance using the register_all(), register_tools(), register_resources(), or register_prompts() methods provided by the mixin.
Includes support for Tools:
Prompts:
Resources:
Usage
Inherit from MCPMixin and use the decorators on the methods you want to register.
from mcp.types import ToolAnnotations
from fastmcp import FastMCP
from fastmcp.contrib.mcp_mixin import MCPMixin, mcp_tool, mcp_resource, mcp_prompt
class MyComponent(MCPMixin):
@mcp_tool(name="my_tool", description="Does something cool.")
def tool_method(self):
return "Tool executed!"
# example of disabled tool
@mcp_tool(name="my_tool", description="Does something cool.", enabled=False)
def disabled_tool_method(self):
# This function can't be called by client because it's disabled
return "You'll never get here!"
# example of excluded parameter tool
@mcp_tool(
name="my_tool", description="Does something cool.",
enabled=False, exclude_args=['delete_everything'],
)
def excluded_param_tool_method(self, delete_everything=False):
# MCP tool calls can't pass the "delete_everything" argument
if delete_everything:
return "Nothing to delete, I bet you're not a tool :)"
return "You might be a tool if..."
# example tool w/annotations
@mcp_tool(
name="my_tool", description="Does something cool.",
annotations=ToolAnnotations(
title="Attn LLM, use this tool first!",
readOnlyHint=False,
destructiveHint=False,
idempotentHint=False,
)
)
def tool_method(self):
return "Tool executed!"
# example tool w/everything
@mcp_tool(
name="my_tool", description="Does something cool.",
enabled=True,
exclude_args=['delete_all'],
annotations=ToolAnnotations(
title="Attn LLM, use this tool first!",
readOnlyHint=False,
destructiveHint=False,
idempotentHint=False,
)
)
def tool_method(self, delete_all=False):
if delete_all:
return "99 records deleted. I bet you're not a tool :)"
return "Tool executed, but you might be a tool!"
@mcp_resource(uri="component://data")
def resource_method(self):
return {"data": "some data"}
# Disabled resource
@mcp_resource(uri="component://data", enabled=False)
def resource_method(self):
return {"data": "some data"}
# prompt
@mcp_prompt(name="A prompt")
def prompt_method(self, name):
return f"Whats up {name}?"
# disabled prompt
@mcp_prompt(name="A prompt", enabled=False)
def prompt_method(self, name):
return f"Whats up {name}?"
mcp_server = FastMCP()
component = MyComponent()
# Register all decorated methods with a prefix
# Useful if you will have multiple instantiated objects of the same class
# and want to avoid name collisions.
component.register_all(mcp_server, prefix="my_comp")
# Register without a prefix
# component.register_all(mcp_server)
# Now 'my_comp_my_tool' tool and 'my_comp+component://data' resource are registered (if prefix used)
# Or 'my_tool' and 'component://data' are registered (if no prefix used)
The prefix argument in registration methods is optional. If omitted, methods are registered with their original decorated names/URIs. Individual separators (tools_separator, resources_separator, prompts_separator) can also be provided to register_all to change the separator for specific types.