Sparkle MCP Server

Sparkle MCP Server

Provides secure file access and clipboard history management for Claude AI and other MCP-compatible clients, with sandboxed file operations and search capabilities.

Category
访问服务器

README

Sparkle MCP Server

A powerful Model Context Protocol (MCP) server that provides secure file access and clipboard history management for Claude AI and other MCP-compatible clients.

Features

  • Secure File Access: Restricted to ~/Sparkle folder for safe AI file operations
  • Advanced File Search: Pattern matching, content search, and relevance scoring
  • Clipboard History: Search and query clipboard history from ~/Sparkle/Pasteboard/
  • Binary File Support: Handles PDFs, images, and other binary files (up to 100MB)
  • Smart File Indexing: Automatic file indexing with 50KB content sampling for search
  • Multiple File Operations: Read, write, move, create directories, and get file info

Installation

Option 1: NPM Install (Recommended)

npm install -g @every-env/sparkle-mcp-server

Option 2: From Source

git clone https://github.com/EveryInc/sparkle-mcp-server.git
cd sparkle-mcp-server
npm install
npm run build
npm link

Quick Setup

Option 1: Zero Install (Recommended) 🚀

Just add this to your Claude Desktop config (~/.config/claude/config.json):

{
  "mcpServers": {
    "sparkle": {
      "command": "npx",
      "args": ["-y", "@every-env/sparkle-mcp-server"]
    }
  }
}

That's it! Restart Claude Desktop and you're done. No installation needed!

Option 2: Traditional Install

If you prefer a local installation:

npm install -g @every-env/sparkle-mcp-server

Then use this config:

{
  "mcpServers": {
    "sparkle": {
      "command": "sparkle-mcp"
    }
  }
}

Available Tools

File Operations

  • list_directory - List files and directories
  • search_files - Search with glob patterns (*, *.txt, etc.)
  • get_relevant_files - AI-powered file search and ranking
  • read_file - Read file contents (text and binary)
  • write_file - Create or overwrite files
  • move_file - Move or rename files
  • create_directory - Create directories
  • get_file_info - Get file metadata

Clipboard History

  • search_clipboard - Search clipboard history with filters
  • get_clipboard_by_date - Get clipboard entries for a specific date
  • get_recent_clipboard - Get recent clipboard entries
  • clipboard_stats - Usage statistics and analytics

System

  • health_check - Server status and diagnostics

Usage Examples

Basic File Operations

// List all files in Sparkle folder
list_directory({ path: "" })

// Search for all text files
search_files({ path: "", pattern: "*.txt" })

// Find relevant files with AI
get_relevant_files({ query: "my tax documents", maxFiles: 5 })

Clipboard History

// Search clipboard for specific text
search_clipboard({ query: "password", limit: 20 })

// Get today's clipboard
get_clipboard_by_date({ date: "2025-08-05" })

// Recent clipboard history
get_recent_clipboard({ days: 7, limit: 50 })

Directory Structure

~/Sparkle/                    # Main Sparkle directory
├── README.txt               # Welcome file (auto-created)
├── Pasteboard/              # Clipboard history
│   ├── 2025-08-05/         # Daily clipboard folders
│   │   ├── clipboard.json  # Clipboard entries
│   │   └── ...
├── Documents/              # Your documents
├── Images/                 # Your images
└── ...                     # Any other files/folders

Clipboard History Format

The server supports multiple clipboard storage formats:

JSON Format (clipboard.json)

[
  {
    "timestamp": "2025-08-05T10:30:00Z",
    "content": "Hello world",
    "type": "text",
    "metadata": {
      "app": "Safari",
      "size": 11
    }
  }
]

Text Format (clipboard.txt)

2025-08-05 10:30:00 | text | Hello world
2025-08-05 10:31:15 | url | https://example.com

Swift Integration

If you have a Swift Sparkle app, here's how to integrate:

1. MCP Server Communication

import Foundation

class SparkleManager {
    private let serverProcess: Process
    
    init() {
        serverProcess = Process()
        serverProcess.executableURL = URL(fileURLWithPath: "/usr/local/bin/sparkle-mcp")
        // Configure stdio pipes for MCP communication
    }
    
    func sendMCPRequest(_ request: MCPRequest) async throws -> MCPResponse {
        // Implement MCP protocol communication
    }
}

2. File Operations

// Search files
let searchResult = try await sparkleManager.sendMCPRequest(
    MCPRequest(method: "tools/call", params: [
        "name": "search_files",
        "arguments": ["path": "", "pattern": "*.pdf"]
    ])
)

// Read file
let fileContent = try await sparkleManager.sendMCPRequest(
    MCPRequest(method: "tools/call", params: [
        "name": "read_file", 
        "arguments": ["path": "document.txt"]
    ])
)

3. Clipboard Integration

// Save clipboard to Pasteboard folder
func saveClipboard() {
    let pasteboard = NSPasteboard.general
    if let string = pasteboard.string(forType: .string) {
        let clipboardEntry = ClipboardEntry(
            timestamp: Date(),
            content: string,
            type: "text"
        )
        saveToSparkleFolder(clipboardEntry)
    }
}

// Query clipboard history via MCP
let recentClipboard = try await sparkleManager.sendMCPRequest(
    MCPRequest(method: "tools/call", params: [
        "name": "get_recent_clipboard",
        "arguments": ["days": 7, "limit": 50]
    ])
)

Configuration

The server uses ~/Sparkle/.mcp-config.json for configuration:

{
  "version": "1.0.0",
  "created": "2025-08-05T10:00:00Z",
  "settings": {
    "sparkleFolder": "~/Sparkle",
    "maxFileSize": 104857600,
    "allowedExtensions": ["*"],
    "autoIndex": true,
    "watcherEnabled": true
  }
}

Security Features

  • Sandboxed Access: Only ~/Sparkle folder is accessible
  • File Size Limits: 100MB maximum file size
  • Path Validation: Prevents directory traversal attacks
  • Rate Limiting: 100 requests per minute
  • Safe File Types: Blocks executable files by default

Development

# Clone and setup
git clone https://github.com/EveryInc/sparkle-mcp-server.git
cd sparkle-mcp-server
npm install

# Development mode
npm run dev

# Build
npm run build

# Test
npm test

Publishing Steps (For Maintainers)

  1. Update version: npm version patch|minor|major
  2. Build: npm run build
  3. Publish: npm publish --access public

Troubleshooting

Server Won't Start

# Check if installed correctly
which sparkle-mcp

# Test server manually
sparkle-mcp --help

# Check logs
tail -f ~/.config/claude/logs/sparkle.log

File Access Issues

  • Ensure ~/Sparkle folder exists and is writable
  • Check file permissions: chmod 755 ~/Sparkle
  • Verify Claude Desktop has proper permissions

Clipboard History Not Working

  • Create ~/Sparkle/Pasteboard/ directory
  • Ensure your clipboard app saves to the correct format
  • Check folder permissions

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

  • Issues: https://github.com/EveryInc/sparkle-mcp-server/issues
  • Documentation: https://github.com/EveryInc/sparkle-mcp-server/wiki
  • Discussions: https://github.com/EveryInc/sparkle-mcp-server/discussions

Built with ❤️ by Every Inc

推荐服务器

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

官方
精选