visitproject

visitproject

Converts legacy supply chain databases and file drops into MCP servers for AI agents, enabling direct interaction with closed systems via CLI.

Category
访问服务器

README

visitproject

Convert legacy enterprise systems into standard MCP servers for AI agents. Point visitproject at a database, get a tools/list of every table exposed as a parameterised MCP tool. No SQL, no ad-hoc glue code, no ; DROP TABLE risks.

   visitproject - DB-to-MCP adapter for AI agents
   =============================================
        DB-TO-MCP     FILE-TO-MCP    MCP-SERVER-OVER-STDIO
        (stage 2 ✅)  (stage 3)      (stage 4 + TUI gateway)

What is visitproject?

Most enterprise systems (WMS, OMS, TMS, BMS, ERPs) are decades old: closed databases, file drops, no public APIs. AI agents can't talk to them without a custom integration for every system.

visitproject is the opposite: a single CLI that points at a database and emits a standards-compliant Model Context Protocol tools/list — one MCP tool per table operation, all parameterised, all safe.

Stage Command Status
1 visitproject db --type <sqlite|mysql|postgres> --conn <str> (scaffold) ✅ shipped
2 visitproject db ... — full DB-to-MCP, parameterised queries, MCP JSON Schema ✅ shipped (this release)
3 visitproject watch --dir <path> --type <csv|xlsx> — File-to-MCP 🔜
4 visitproject start --config <path> — stdio MCP server + TUI + safety gateway 🔜

Stage 2 quickstart — DB-to-MCP in 30 seconds

git clone https://github.com/linmy666/visitproject
cd visitproject
npm install --include=dev
npm run build

# Generate the example database
node scripts/seed-example-db.js
# → wrote examples/sample.db (4 tables: users, products, orders, line_items)

# Emit MCP tool JSON for every table in the database
node dist/cli/index.js db --type sqlite --conn sqlite:examples/sample.db --print | head -40

# Or get a human-readable summary
node dist/cli/index.js db --type sqlite --conn sqlite:examples/sample.db
# → [stage 2] 16 MCP tool(s) generated for sqlite://examples/sample.db
#     • db_select_line_items   — Read rows from table 'line_items'. …
#     • db_insert_line_items   — Insert one row into table 'line_items'.
#     • db_update_line_items   — Update rows in table 'line_items' matching …
#     • db_delete_line_items   — Delete rows from table 'line_items' matching …
#     • db_select_orders       — Read rows from table 'orders'. …
#     … (16 tools total: 4 tables × 4 operations)

Filtering to a subset of tables

node dist/cli/index.js db --type sqlite --conn sqlite:examples/sample.db \
  --tables users,orders --print
# → only db_{select,insert,update,delete}_{users,orders} appear (8 tools)

Architecture

┌──────────────────────────────────────────────────────────────────┐
│  L4  TUI Dashboard + AI Safety Gateway     [stage 4]              │
│      (blessed dashboard, real-time MCP traffic, Y/N circuit-     │
│       breaker before any write tool fires)                       │
├──────────────────────────────────────────────────────────────────┤
│  L3  MCP Server on stdio                  [stage 4]              │
│      (@modelcontextprotocol/sdk Server + transport)              │
├──────────────────────────────────────────────────────────────────┤
│  L2  Resource Pipeline (File-to-MCP)      [stage 3]              │
│      (chokidar watcher → CSV/XLSX parse → MCP Resources)         │
├──────────────────────────────────────────────────────────────────┤
│  L1  DB-to-MCP Adapter                    [stage 2 ✅]           │
│  ┌─────────────┐  ┌──────────────┐  ┌──────────────────────┐     │
│  │ SqliteAdapter│  │ buildWhere() │  │ toolsForAdapter()    │     │
│  │ (better-sql3)│  │ (whitelist) │  │ → JSON Schema + name │     │
│  └─────────────┘  └──────────────┘  └──────────────────────┘     │
└──────────────────────────────────────────────────────────────────┘

Safety guarantees (stage 2)

  1. Parameterised queries everywhere. buildWhere() produces ?-placeholder SQL with a parallel params array. Identifiers go through a strict ASCII whitelist (/^[a-zA-Z_][a-zA-Z0-9_$]*$/).
  2. No raw ; DROP TABLE style attacks. A condition referencing a non-whitelisted column throws DbError(UNKNOWN_COLUMN). A column with ; or -- or a hyphen fails validateIdentifier() with DbError(INVALID_IDENTIFIER).
  3. Bounded reads. SELECT always appends LIMIT ? (clamped to 1-1000). Truncation is signalled to the LLM via SelectResult.truncated = true.
  4. No naked DELETE / UPDATE. Both require a where clause; empty where is rejected with DbError(QUERY_REJECTED).
  5. MAX_PARAMS = 64 hard cap on total placeholders per query.

Tests

npm test

59/59 tests passing across 5 suites:

  • test/db/schema.test.ts — 13 tests for SQLite type parsing + identifier whitelist (covers injection attack vectors)
  • test/db/sqlite.test.ts — 15 tests for SqliteAdapter (connection lifecycle, listTables, describeTable, select/insert/update/delete)
  • test/db/query.test.ts — 14 tests for buildWhere (all operators, whitelist enforcement, MAX_PARAMS, like/in edge cases)
  • test/db/mcp-tools.test.ts — 8 tests for toolsForTable and toolsForAdapter (per-table tool count, JSON Schema shape, enums, integration)
  • test/unit/cli.test.ts — 9 tests for commander wiring (stage 1 smoke tests + stage 2 db subcommand end-to-end via a seeded SQLite file)

Module layout

src/
├── cli/
│   └── index.ts          # commander entry point
├── db/                   # stage 2: DB-to-MCP
│   ├── adapter.ts        # DbAdapter interface (SQL injection boundary)
│   ├── schema.ts         # PRAGMA table_info parsing + type normalisation
│   ├── sqlite.ts         # SqliteAdapter (better-sqlite3)
│   ├── query.ts          # buildWhere() — parameterised WHERE builder
│   ├── mcp-tools.ts      # table → McpTool[] (JSON Schema)
│   └── index.ts          # public surface (barrel)
├── filewatch/            # stage 3: File-to-MCP (placeholder)
├── server/               # stage 4: stdio MCP server (placeholder)
├── tui/                  # stage 4: blessed TUI (placeholder)
└── util/

Requirements

  • Node.js ≥ 18
  • TypeScript 5.6+ (build only)
  • npm 9+
  • Native build toolchain (Xcode CLT on macOS) — required by better-sqlite3

If npm install is run with --ignore-scripts and you later need better-sqlite3, run npm run build-release inside node_modules/better-sqlite3.

Roadmap

  • Stage 1: scaffold, CLI skeleton, tests
  • Stage 2 (this release): DB-to-MCP — introspect tables, generate MCP Tool JSON, parameterise queries (no SQL injection), MySQL/PostgreSQL adapters in 2.5
  • 🔜 Stage 3: File-to-MCP — chokidar watcher + CSV/XLSX parser
  • 🔜 Stage 4: Stdio MCP server + blessed TUI dashboard + Y/N circuit-breaker for write tools

License

MIT. See LICENSE.

Contact

Lin Ruihan — chuiniu@me.comgithub.com/linmy666

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选