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.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.svg" alt="Measured on agentmods" 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 $0.02256 $0.02256
Sonnet 5 $0.00902 $0.00902
Haiku 4.5 $0.00451 $0.00451

Measured 8d ago against content hash f2742edc341f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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. 8d 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 1mo ago), licensed MIT. It adds 4,512 tokens to every session, about $0.0226 per session on Opus 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

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens