Skip to main content
Glama

veyra-snippets

一个为 AI 智能体设计的持久化代码片段管理器 MCP 工具,支持语言过滤、标签搜索和全文代码搜索。读取操作始终免费。写入操作需要 Veyra 提交模式授权。

概述

veyra-snippets 为 AI 智能体提供了一个基于 SQLite 的可靠代码库。智能体可以自由浏览和搜索代码片段。保存、更新和删除代码片段受到 Veyra 提交模式的保护,确保写入操作是有意且可追溯的。

Related MCP server: Snippets MCP

安装

npm install
npm run build

代码片段存储在 ~/.veyra-snippets/data.db 中,首次运行时会自动创建。

MCP 配置 (Claude Desktop)

将以下内容添加到你的 claude_desktop_config.json 中:

{
  "mcpServers": {
    "veyra-snippets": {
      "command": "node",
      "args": ["/absolute/path/to/veyra-snippets/dist/index.js"]
    }
  }
}

工具

工具

输入

分类

价格

list_snippets

{ language?, tag? }

—

免费

get_snippet

{ id }

—

免费

search_snippets

{ query }

—

免费

save_snippet

{ title, code, language, tags?, veyra_token? }

A

€0.005

update_snippet

{ id, code?, title?, veyra_token? }

A

€0.005

delete_snippet

{ id, veyra_token? }

B

€0.02

示例

读取(无需令牌)

// List all snippets
{ "tool": "list_snippets", "arguments": {} }

// List TypeScript snippets
{ "tool": "list_snippets", "arguments": { "language": "typescript" } }

// List snippets by tag
{ "tool": "list_snippets", "arguments": { "tag": "auth" } }

// Get a specific snippet
{ "tool": "get_snippet", "arguments": { "id": "1712345678-abc1234" } }

// Search across title, code, language, and tags
{ "tool": "search_snippets", "arguments": { "query": "debounce" } }

写入(需要 Veyra 令牌)

// Save a new snippet
{
  "tool": "save_snippet",
  "arguments": {
    "title": "Debounce utility",
    "code": "function debounce(fn, ms) {\n  let timer;\n  return (...args) => {\n    clearTimeout(timer);\n    timer = setTimeout(() => fn(...args), ms);\n  };\n}",
    "language": "javascript",
    "tags": "utility,performance",
    "veyra_token": "vt_..."
  }
}

// Update snippet code
{
  "tool": "update_snippet",
  "arguments": {
    "id": "1712345678-abc1234",
    "code": "// updated code here",
    "veyra_token": "vt_..."
  }
}

// Delete a snippet
{
  "tool": "delete_snippet",
  "arguments": {
    "id": "1712345678-abc1234",
    "veyra_token": "vt_..."
  }
}

缺少令牌时的错误响应

{
  "error": "VeyraCommitRequired",
  "message": "Write operations require Veyra commit mode.",
  "currentMode": "open",
  "requiredMode": "commit",
  "transitionStrategy": "authorize_then_retry_with_x_veyra_token",
  "provider": "veyra",
  "authorize_endpoint": "https://api.veyra.to/v1/authorize-action",
  "docs_url": "https://veyra.to"
}

Veyra 的工作原理

Veyra 是 AI 智能体的提交模式授权层。当智能体尝试执行写入操作时:

  1. 智能体在不带 veyra_token 的情况下调用工具,并收到带有 authorize_endpoint 的 VeyraCommitRequired 错误。

  2. 智能体(或代表它的用户)调用授权端点以获取令牌。

  3. 智能体使用设置好的 veyra_token 重试工具调用。

  4. veyra-snippets 在执行写入前通过 @veyrahq/sdk-node 验证令牌。

完整文档请参阅 veyra.to。

许可证

MIT

托管包(推荐)

建议使用托管包以实现单 URL 集成:

{
  "mcpServers": {
    "veyra": {
      "url": "https://mcp.veyra.to/sse"
    }
  }
}

一个 URL。48 个工具。24 个免费读取。24 个受保护的写入。

托管包: https://mcp.veyra.to/sse

包清单: https://mcp.veyra.to/.well-known/veyra-pack.json

当你希望在所有 Veyra 工具系列中获得最快的 MCP 集成路径时,请使用托管包。 当你专门需要单独使用此工具时,请使用此独立包。

Veyra 生态系统的一部分

Veyra 是生产级 AI 智能体操作的提交模式。 所有工具:读取免费,写入需要 Veyra 提交模式。

工具

描述

安装

veyra-memory

键值存储

npm i -g veyra-memory

veyra-notes

带标签的笔记记录

npm i -g veyra-notes

veyra-tasks

任务管理

npm i -g veyra-tasks

veyra-bookmarks

书签管理器

npm i -g veyra-bookmarks

veyra-contacts

联系人管理

npm i -g veyra-contacts

veyra-forms

表单构建器

npm i -g veyra-forms

veyra-webhooks

Webhook 发送器

npm i -g veyra-webhooks

SDK: npm install @veyrahq/sdk-node 网站: veyra.to

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers