visual-primitives-mcp: Instructions file for Codex

AGENTS.md

visual-primitives-mcp AGENTS.md is an instructions file for Codex, OpenCode from Wjl1224734792/visual-primitives-mcp. It costs 4,512 tokens per session, scanned A, original, MIT.

A local server that gives AI tools for understanding images and finding exact locations within them. It first describes what is visible, then uses that context to locate requested objects or points.

In plain words
What is it for?
Use it to describe images, locate objects by coordinates, read text from images, analyze videos, and expose these capabilities to an AI assistant through MCP, a standard way for assistants to call tools.
Why use it?
Separating scene description from coordinate finding helps the system understand the image before answering precise location questions. It also supports image files, text extraction from images, and video analysis.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

This is Wjl1224734792/visual-primitives-mcp's own configuration. It tells Codex and OpenCode how to work on visual-primitives-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything visual-primitives-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Wjl1224734792/visual-primitives-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Wjl1224734792/visual-primitives-mcp/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Wjl1224734792/visual-primitives-mcp

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for visual-primitives-mcp AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/wjl1224734792/visual-primitives-mcp/agents-md/github.svg)](https://agentmods.dev/instructions/wjl1224734792/visual-primitives-mcp/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/wjl1224734792/visual-primitives-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/wjl1224734792/visual-primitives-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for visual-primitives-mcp AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/wjl1224734792/visual-primitives-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/wjl1224734792/visual-primitives-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,512 This file is loaded in full into every session.
When invoked 4,512 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.04512 $0.04512
Opus 5.5 $0.01805 $0.01805
Sonnet 5.5 $0.00902 $0.00902
Haiku 4.5 $0.00451 $0.00451

Measured 2mo ago against content hash f2742edc341f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

visual-primitives-mcp AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 353 lines

How it starts

The opening of the file, as written. The whole thing — 353 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Visual Primitives MCP — 架构文档

基于 DeepSeek《Thinking with Visual Primitives》论文的多模态视觉理解 MCP 服务器。核心创新:任务调度 + 两阶段推理——先让模型看清画面(describe),再基于完整上下文追问坐标(locate),每一步专注做好一件事。


1. 项目概述

将视觉模型的场景理解和坐标定位能力封装为 6 个专注 MCP 工具,通过任务调度机制实现两阶段精确空间推理。visual_describe 先理解场景 → visual_locate 再精确定位 → 两者通过共享会话上下文联动。

属性 值
运行时 Node.js >= 22.5.0
语言 TypeScript (strict)
MCP 协议 @modelcontextprotocol/sdk v1.x
HTTP 层 Hono(仅 SSE/HTTP Stream)
持久化 node:sqlite(内置)
校验 Zod
日志 pino(敏感字段脱敏)
测试 vitest(13 文件 176 用例)

2. 架构分层

┌──────────────────────────────┐
│         入口层 (src/)         │
│  server.ts / config.ts       │
│  types.ts                    │
├──────────────────────────────┤
│       传输层 (transport/)    │
│  factory.ts                  │
├──────────────────────────────┤
│      处理器层 (handlers/)    │
│  tool-handlers.ts (4 工具)   │
│  encodeFileBase64() 读文件   │
├──────────────────────────────┤
│       核心管道层 (core/)     │
│  ┌────────────────────────┐  │
│  │ pipeline.ts (任务调度)  │  │
│  │  describe | locate     │  │
│  │  ocr | video_analyze   │  │
│  │ parser.ts / validator  │  │
│  │ normalizer.ts          │  │
│  │ prompt-builder.ts      │  │
│  │ vision-client.ts       │  │
│  │ session-manager.ts     │  │
│  └────────────────────────┘  │
├──────────────────────────────┤
│       工具层 (utils/)        │
│  logger.ts / retry.ts        │
├──────────────────────────────┤
│       模板层 (templates/)        │
│  describe-structured.txt         │
│  locate-system.txt               │
│  ocr-system.txt                  │
└──────────────────────────────┘

3. 各层详解

3.1 入口层 (src/)

server.ts — 服务主入口
  • 初始化链:SessionManager → VisionClient → PipelineOrchestrator → McpServer
  • 注册 6 个视觉任务工具(describe/locate/ocr/video/compare/diagnose 均支持会话上下文注入)
  • 根据 MCP_TRANSPORT 环境变量选择传输模式(stdio / sse / http-stream)
  • Hono 仅在 SSE/HTTP Stream 模式动态加载,stdio 零开销
  • 启动 60s 间隔的 TTL 会话清理定时器
  • SIGINT/SIGTERM 优雅关闭:清定时器 → 关 SQLite → 退出

Read the full file on GitHub · 353 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 353 lines · 4,512 tokens per session scan A f2742edc341f

Subscribe to this mod's changes

visual-primitives-mcp AGENTS.md is an instructions file published in the GitHub repository Wjl1224734792/visual-primitives-mcp (2 stars, last pushed 3mo ago), licensed MIT. It adds 4,512 tokens to every session, about $0.0180 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

visual-primitives-mcp AGENTS.md compared with instructions from other repositories

visual-primitives-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
visual-primitives-mcp AGENTS.mdWjl1224734792/visual-primitives-mcpInstructions file23mo agoMITA4,512Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode