Context for AI assistants working on the agentic-obs project.
agentic-obs is an MCP (Model Context Protocol) server providing AI assistants with programmatic control over OBS Studio via the WebSocket API.
Current Status: 81 Tools | 4 Resources | 14 Prompts | 4 Skills
agentic-obs/
├── main.go # Entry point (MCP server or TUI dashboard)
├── config/config.go # Configuration management
├── internal/
│ ├── mcp/
│ │ ├── server.go # MCP server lifecycle
│ │ ├── tools.go # Tool registration (81 tools)
│ │ ├── resources.go # Resource handlers (4 types)
│ │ ├── prompts.go # Prompt definitions (14 prompts)
│ │ ├── completions.go # Autocomplete handler
│ │ ├── elicitation.go # User confirmation for high-risk tools
│ │ ├── help.go # Help tool
│ │ └── interfaces.go # OBSClient interface
│ ├── obs/
│ │ ├── client.go # WebSocket client
│ │ ├── commands.go # OBS command implementations
│ │ └── events.go # Event handling
│ ├── docs/ # Embedded documentation (go:embed)
│ ├── storage/ # SQLite persistence
│ ├── http/ # Web dashboard & API (/docs/ endpoints)
│ ├── screenshot/ # Background capture
│ └── tui/ # Terminal dashboard (4 views)
├── skills/ # Claude Skills (4 packages)
├── examples/ # Usage examples
├── docs/ # Additional documentation
└── design/ # Architecture & decisions
| Component | Package | Version |
|---|---|---|
| MCP SDK | github.com/modelcontextprotocol/go-sdk |
1.1.0 |
| OBS Client | github.com/andreykaipov/goobs |
1.5.6 |
| SQLite | modernc.org/sqlite |
latest |
| TUI | github.com/charmbracelet/bubbletea |
1.3.3 |
| Markdown (HTML) | github.com/yuin/goldmark |
1.7.x |
| Markdown (Terminal) | github.com/charmbracelet/glamour |
0.8.x |
AI Assistant (Claude)
↕ stdio (JSON-RPC)
MCP Server (agentic-obs)
├─ Tools (81) ─────────┐
├─ Resources (4) ──────┼─→ OBS Client ─→ OBS Studio
├─ Prompts (13) ───────┘ ↕ WebSocket (4455)
└─ Storage ─────────────→ SQLite
Web Dashboard (localhost:8765)
↕ HTTP/REST
HTTP Server
└─ StatusProvider/ActionExecutor interfaces
# MCP server (default)
go run main.go
# TUI dashboard
go run main.go --tui
# Build
go build -o agentic-obsgo test ./...- Follow standard Go conventions (gofmt, go vet)
- Use meaningful variable names
- Keep functions focused and concise
- Always check errors, provide context
- Use
internal/for private packages
- Define schema in
internal/mcp/tools.go:
{
Name: "my_tool",
Description: "Does something useful",
InputSchema: myToolSchema,
}- Implement handler:
func (s *Server) handleMyTool(ctx context.Context, params json.RawMessage) (*mcpsdk.CallToolResult, error) {
// Implementation
}-
Register in
registerToolHandlers() -
Add OBS command in
internal/obs/commands.goif needed
- Define in
internal/mcp/resources.go - Implement
handleResourceRead()case - Add to
handleResourcesList() - Add OBS event handlers for notifications
- Define in
internal/mcp/prompts.go:
{
Name: "my-prompt",
Description: "Description",
Arguments: []mcpsdk.PromptArgument{...},
}- Add message generation in
handleGetPrompt()
go get -u github.com/modelcontextprotocol/go-sdk
go get -u github.com/andreykaipov/goobs
go mod tidy| Group | Count | Examples |
|---|---|---|
| Core | 25 | list_scenes, start_recording, get_obs_status, toggle_virtual_cam, save_replay_buffer, toggle_studio_mode, trigger_hotkey_by_name |
| Sources | 3 | list_sources, toggle_source_visibility |
| Audio | 4 | toggle_input_mute, set_input_volume |
| Layout | 6 | save_scene_preset, apply_scene_preset |
| Visual | 4 | create_screenshot_source, list_screenshot_sources |
| Design | 14 | create_text_source, set_source_transform |
| Filters | 7 | list_source_filters, toggle_source_filter |
| Transitions | 5 | list_transitions, set_current_transition |
| Automation | 9 | list_automation_rules, create_automation_rule, trigger_automation_rule |
| Meta | 4 | help, get_tool_config, set_tool_config, list_tool_groups (always enabled) |
| Type | URI Pattern | Content |
|---|---|---|
| Scenes | obs://scene/{name} |
Scene configuration JSON |
| Screenshots | obs://screenshot/{name} |
Binary image data |
| Screenshot URLs | obs://screenshot-url/{name} |
HTTP URL string |
| Presets | obs://preset/{name} |
Preset configuration JSON |
stream-launch, stream-teardown, audio-check, visual-check, health-check, problem-detection, preset-switcher, recording-workflow, scene-organizer, quick-status, scene-designer, source-management, visual-setup, automation-setup
For detailed rationale, see design/decisions/.
- Pure Go SQLite (
modernc.org/sqlite) - No CGO for easy cross-compilation - Persistent OBS Connection - Single 1:1 connection with auto-reconnect
- Scenes as Resources - Enable MCP notifications for state synchronization
- Tool Groups - Configurable categories (Core, Visual, Layout, Audio, Sources, Design, Filters, Transitions, Automation)
- Interface Pattern - StatusProvider/ActionExecutor for web UI decoupling
| Document | Purpose |
|---|---|
| README.md | User documentation |
| CHANGELOG.md | Version history |
| docs/BUILD.md | Build, test, release |
| design/ARCHITECTURE.md | System diagrams |
| design/ROADMAP.md | Future plans |
| design/decisions/ | ADRs |
| docs/TROUBLESHOOTING.md | Common issues |
| docs/TOOLS.md | Detailed tool reference |
- Storage tests:
internal/storage/*_test.go - MCP tests:
internal/mcp/*_test.go(uses mock OBS client) - Mock client:
internal/mcp/testutil/mock_obs.go
- Single OBS instance only (multi-instance planned)
- OBS password stored unencrypted in SQLite (local deployment)
- Resource notifications require persistent OBS connection
Last Updated: 2025-12-19 | Go: 1.25.5 | MCP SDK: 1.1.0 | goobs: 1.5.6