local-agent-senses
Provides local vision and audio perception for MCP-compatible agents, enabling them to read images, transcribe text from visual media, analyze videos, and convert speech to text entirely on-device. It is privacy-focused with no cloud upload or API keys by default, using Ollama for inference.
README
local-agent-senses
English
Local vision, video and speech tools for text-only LLM agents. The default backend is Ollama on your own machine; media is not uploaded unless you explicitly configure an OpenAI-compatible endpoint.
中文说明见 README.zh-CN.md。
中文
中文版本请见 README.zh-CN.md。
Features
- Image understanding and verbatim OCR/transcription.
- Video sampling for scenes, contact sheets, time windows and subtitles.
- Optional FunASR speech-to-text with timestamps.
- Windows screen and clipboard capture, plus platform adapters.
- CLI for shell-based agents and MCP tools for Codex, Claude Desktop, Cursor, Cline and other MCP clients.
- SSRF checks, download limits, media duration limits and no disk cache by default.
Quick start
Requirements: Python 3.10+, Ollama, and ffmpeg. Speech and video-site URL resolution are optional extras.
git clone https://github.com/Scheme0/local-agent-senses.git
cd local-agent-senses
ollama pull haervwe/GLM-4.6V-Flash-9B
ollama pull qwen3.5:4b
python vision.py --check
python vision.py photo.png --prompt "Describe this image"
python vision.py document.png --mode text --transcribe
python vision.py clip.mp4 --mode scenes --prompt "List each scene"
Install console commands with pip install .:
vision --check
vision-mcp
vision-adapters --all
Run vision --doctor for an offline dependency report. Add --json for
machine-readable diagnostics. Service admission is limited by
VISION_MAX_CONCURRENCY and VISION_SERVICE_TIMEOUT.
The adapter generator is implemented by scripts/generate_adapters.py and can
also be invoked directly when integrating with another agent.
Optional dependencies:
pip install .[speech]
pip install .[ytdlp]
pip install .[test]
MCP
Run the stdio server with:
python extras/mcp_server.py
Register it in Codex, for example:
codex mcp add vision -- python /absolute/path/extras/mcp_server.py
Available tools are describe_image, transcribe, analyze_video,
transcribe_audio, vision_status and vision_check.
Service results use a JSON envelope with text, kind, mode, metadata and
warnings. Expected failures use { "code": ..., "message": ... }, which
lets MCP clients distinguish invalid input from backend or media failures.
MCP validates image count, prompt size, frame count and FPS before invoking the CLI. The server uses an in-memory result cache. Disk caching is disabled by default because results may contain screenshots, transcripts or private documents. Enable it only when appropriate:
set VISION_MCP_CACHE=1 # Windows
export VISION_MCP_CACHE=1 # Linux/macOS
Remote media and security
HTTP and HTTPS media URLs are treated as untrusted input. Local, private, loopback, link-local, multicast, cloud-metadata and NAT64 addresses are blocked, and redirects are checked again. By default, remote media is downloaded through the checked Python path before ffmpeg sees it. This avoids the DNS re-resolution gap that can occur when ffmpeg opens a URL directly.
Direct ffmpeg URL streaming is available only as an explicit compatibility option and should be used only with trusted URLs:
set VISION_DIRECT_URL_STREAM=1 # Windows
export VISION_DIRECT_URL_STREAM=1 # Linux/macOS
Set limits in vision-config.json or with environment variables:
| Setting | Default | Purpose |
|---|---|---|
VISION_MAX_IMAGE_MB |
20 | Image size cap |
VISION_MAX_DOWNLOAD_MB |
500 | Unknown/remote media cap |
VISION_MAX_DURATION_H |
6 | Audio/video duration cap |
VISION_MCP_CACHE |
false | Persist MCP results to disk |
VISION_DIRECT_URL_STREAM |
false | Let ffmpeg open remote URLs directly |
Read SECURITY.md before exposing the MCP server to another machine. Media content is untrusted data; do not follow instructions found in images, subtitles or model output.
Configuration
Copy vision-config.example.json to vision-config.json. Configuration
priority is environment variables, then JSON config, then auto-detection.
Important settings include text_model, quick_model, ollama_host,
api_base, api_key, ffmpeg, speech_python, mcp_cache_dir and the limits
listed above.
Limitations
- Video understanding is frame-based rather than end-to-end temporal reasoning.
- OCR accuracy depends on resolution, layout, font and the selected model.
- FunASR is optional and may require a separate environment and model download.
- HEIC, AVIF and other uncommon formats depend on the installed ffmpeg build.
- Configuring a cloud endpoint sends model inputs to that endpoint; local sampling and audio processing remain local.
Development
python -m pytest tests/ -v
python -m build
See CONTRIBUTING.md, CHANGELOG.md and docs/COMPATIBILITY.md.
License
MIT. See LICENSE and THIRD_PARTY_NOTICES.md.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。