Attachpad

Attachpad

Enables MCP clients to retrieve focused context from a browser-scoped workspace, supporting file uploads, web imports, and prioritized retrieval via SQLite FTS5.

Category
访问服务器

README

Attachpad

Attachpad is a browser-scoped context control center for MCP clients. Upload files, import public web pages, arrange sources by importance, and let an MCP-compatible client retrieve focused context instead of sending an entire file library every time.

Built with GPT-5.6 and Codex

Attachpad was fully built with GPT-5.6 and Codex: from the React Router interface and MCP server to SQLite/Drizzle persistence, document normalization, retrieval, and deployment configuration. Codex was used as the implementation partner throughout the project.

What it does

  • Stores files in a local SQLite database using Drizzle ORM.
  • Associates every source with a browser-local session ID.
  • Accepts drag-and-drop uploads and public URL imports.
  • Converts uploaded PDFs and imported HTML pages into agent-readable Markdown.
  • Preserves manual source order and a 1–5 priority weight.
  • Indexes normalized content locally with SQLite FTS5.
  • Exposes focused retrieval tools through a React Router MCP endpoint.
  • Makes no external embedding or search API calls.

Architecture

flowchart LR
    browser["Browser workspace<br/>local session ID"]
    client["MCP client<br/>VS Code, ChatGPT, or another client"]

    subgraph app["Attachpad React Router server"]
        ui["Context control center"]
        filesApi["Files API<br/>uploads, imports, ordering"]
        mcp["MCP endpoint<br/>JSON-RPC over HTTP"]
        importer["Document normalizer<br/>PDF and HTML to Markdown"]
        indexer["Chunking and ranking<br/>priority and manual order"]
    end

    subgraph data["SQLite database"]
        files[("files")]
        chunks[("attachment chunks")]
        fts[("FTS5 search index")]
    end

    browser --> ui
    browser -->|"session-scoped changes"| filesApi
    filesApi --> importer
    filesApi --> files
    filesApi --> indexer
    importer --> files
    indexer --> chunks
    indexer --> fts
    client -->|"MCP URL with session ID"| mcp
    mcp --> fts
    mcp --> files

Request flow

  1. The browser creates a UUID and stores it in localStorage under attachpad-session.
  2. Uploads and URL imports send that ID as x-session-id.
  3. The server stores raw content and normalized Markdown in SQLite.
  4. Content is split into chunks and indexed in SQLite FTS5.
  5. The MCP client calls a retrieval tool with the same session ID in the MCP URL.
  6. Search results combine text relevance, manual order, and priority weight.

MCP endpoint

The workspace displays a session-specific URL such as:

http://localhost:5173/mcp?session_id=YOUR_SESSION_ID

Use that URL as an HTTP MCP server. Keep it private: the URL grants access to that browser session's context.

Exposed tools

Tool Purpose
list_attached_files Returns metadata only, in manual context order.
search_attached_files Searches local SQLite FTS5 chunks using keyword and prefix matching.
read_attached_file Reads one file by ID with a character limit.
get_relevant_context Searches and assembles ranked chunks within a character budget.
get_attached_files Compatibility tool that returns all attached context, or one file by ID.

Priority semantics are communicated to the MCP client: earlier manual position means higher user preference, and priority 1–5 provides an additional retrieval boost. Relevance still matters.

Local development

Requirements

  • Node.js 20+
  • npm

Install and run

npm install
npm run dev

Open http://localhost:5173 in a browser.

SQLite and Drizzle

The default database is file:./data/attachpad.db. The application bootstraps missing tables and indexes when the server first receives a request, including the FTS5 search table.

Optional Drizzle commands:

npm run db:generate
npm run db:migrate
npm run db:push

For the current local bootstrap flow, no database command is required before npm run dev.

To use another supported libSQL-compatible URL, set SQLITE_DATABASE_URL. PostgreSQL URLs are intentionally ignored because Attachpad uses SQLite/libSQL.

VS Code setup

Create .vscode/mcp.json in the workspace:

{
  "servers": {
    "attachpad": {
      "type": "http",
      "url": "http://localhost:5173/mcp?session_id=YOUR_SESSION_ID"
    }
  }
}

Replace YOUR_SESSION_ID with the URL copied from the Attachpad MCP settings drawer. Restart the server with npm run dev, then use MCP: List Servers in VS Code to start or refresh Attachpad.

Project structure

app/
├── db/
│   ├── db.server.ts       # SQLite connection, bootstrap, indexing, retrieval
│   └── schema.ts          # Drizzle tables
├── lib/
│   ├── document.server.ts # PDF-to-Markdown normalization
│   └── web-import.server.ts # Safe URL fetching and HTML-to-Markdown
├── routes/
│   ├── home.tsx           # Context control center UI
│   ├── api.files.ts       # Upload, import, delete, priority, reorder
│   └── mcp.ts             # MCP JSON-RPC endpoint and tools
└── routes.ts              # React Router route configuration

data/                     # Local SQLite database directory
drizzle/                  # Drizzle SQL migrations

Security notes

  • There is no account system or authentication in this setup.
  • The session-specific MCP URL functions as a bearer secret.
  • URL imports allow public HTTP(S) targets only and block local/private network addresses.
  • Imported pages are limited to 5 MB and a small redirect budget.
  • Uploaded scanned PDFs are stored, but text extraction may require OCR in a future step.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选