Clipboard MCP Server
This server enables pattern-based file editing operations, allowing you to copy, move, or replace content between files using text patterns as landmarks instead of exact string matching.
Core Capabilities:
Copy/move content between files - Extract content from a source file and insert it into a target file, with optional cut functionality that removes content from the source
Pattern-based selection - Define content using a start pattern combined with either an end pattern or line count
Flexible insertion positioning - Insert content
before,after, orreplacea target marker patternContext-efficient editing - Use familiar code landmarks (function names, comments, class declarations) instead of exact strings, reducing token consumption
Cross-file operations - Transfer code blocks, functions, or text sections between different files in a single operation
Use Cases:
Refactor code by moving functions between files
Duplicate code blocks using recognizable patterns
Insert boilerplate or template code at marked locations
Reorganize code structure without manual copy/paste
Important Limitations:
WARNING: Grants file read/write access across the system without explicit user confirmation per operation
Limited to case-sensitive, literal text pattern matching (no regex support)
Single file transaction per call
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Clipboard MCP Servercopy the calculateTotal function from utils.js to main.js after the imports"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Clipboard MCP Server
โ ๏ธ SECURITY WARNING โ ๏ธ
๐ CRITICAL NOTICE: FILE SYSTEM ACCESS
Installing this MCP server will allow AI agents to READ and modify files on your system without explicit user confirmation for each operation. Only install if you trust the AI system and understand the security implications.
โ ๏ธ Version 0.0.1 - Experimental Release
This is an early experimental version that may contain bugs, incomplete features, and breaking changes. Use at your own risk and expect frequent updates.
๐ฏ Overview
Context-efficient file editing MCP server using pattern-based copy/paste operations. Provides an alternative to traditional exact-string editing tools by using text patterns and markers for content manipulation.
Related MCP server: MCP Files
๐ Quick Start
Prerequisites
Node.js 18+
Claude Code with MCP support
Installation
Clone and build:
git clone <repository-url>
cd clipboard-mcp
npm install
npm run buildConfigure MCP server:
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"clipboard": {
"command": "node",
"args": ["<absolute-path-to-project>/dist/server.js"],
"env": {}
}
}
}Restart Claude Code or run
/mcp reconnect
๐ ๏ธ Usage
The server provides a single copy_paste method for pattern-based file operations:
copy_paste({
source: {
file: string, // Path to source file
start_pattern: string, // Text pattern to find start of content
end_pattern?: string, // Optional: end pattern (if not provided, uses line_count)
line_count?: number // Optional: number of lines from start_pattern
},
target: {
file: string, // Path to target file
marker: string, // Text pattern to find insertion point
position: 'before' | 'after' | 'replace', // Where to insert relative to marker
replace_pattern?: string // Optional: specific pattern to replace (when position='replace')
},
cut?: boolean // Optional: true to cut (move) instead of copy
})Examples
Copy a function:
copy_paste({
source: {
file: '/path/to/source.js',
start_pattern: 'function processData',
end_pattern: '^}'
},
target: {
file: '/path/to/target.js',
marker: '// Insert utilities here',
position: 'after'
}
})Move a code block:
copy_paste({
source: {
file: '/path/to/old.js',
start_pattern: '// Helper functions',
line_count: 10
},
target: {
file: '/path/to/new.js',
marker: '// TODO: Add helpers',
position: 'replace'
},
cut: true
})๐งช Development
Running Tests
npm test # Run all tests
npm run test:watch # Run tests in watch modeDevelopment Mode
npm run dev # MCP server with file watching
npm run dev:http # HTTP server for testing (localhost:3000)HTTP Testing
For debugging, you can test the server logic via HTTP:
# Start HTTP server
npm run dev:http
# Test with curl
curl -X POST http://localhost:3000/copy_paste \
-H "Content-Type: application/json" \
-d '{
"source": {
"file": "/path/to/source.js",
"start_pattern": "function test",
"line_count": 5
},
"target": {
"file": "/path/to/target.js",
"marker": "// Insert here",
"position": "after"
}
}'๐ Why Pattern-Based?
Traditional file editing tools require exact string matching, which:
Consumes large amounts of context tokens
Fails on whitespace differences
Requires precise text copying
Pattern-based approach:
Uses familiar text landmarks (
function name,// comments)Significantly reduces context consumption
More robust to formatting variations
Leverages natural code structure
๐ง Technical Details
Architecture
MCP Server (
src/server.ts) - Protocol compliance and request routingCopy/Paste Handler (
src/handlers/) - Core business logicFile System Storage (
src/services/) - File operations and pattern matchingUtilities (
src/utils/) - Helper functions for position calculations
Error Handling
Pattern not found in source file
Marker not found in target file
File permission and existence checks
Invalid parameter validation
Testing
15 unit tests covering core functionality
Snapshot testing for regression protection
Fixture-based testing with cleanup automation
Edge case coverage (special characters, empty content, etc.)
โ ๏ธ Known Limitations (v0.0.1)
Security Limitations
No file access restrictions - agents can access any readable file
No operation confirmation - file modifications happen immediately
No audit logging - operations are not logged for review
No rollback protection - file changes are permanent
Technical Limitations
Pattern matching is case-sensitive
No regex pattern support yet (only literal text)
Limited to single file operations per call
No undo/rollback functionality
File size limits not enforced
No concurrent operation protection
๐ฃ๏ธ Roadmap
Regex pattern support
Batch operations (multiple files)
Operation history and undo
Performance optimizations
Better error messages
Configuration options
๐ License
MIT License
๐ค Contributing
This is experimental software. Issues and feedback welcome, but expect frequent breaking changes in early versions.
Version 0.0.1 - Initial experimental release
Available Tools
1 toolcopy_pasteC
Copy/paste content between files using text patterns. Find content by search pattern, insert at marker location.
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| target | Yes | ||
| cut | No | Optional: true to cut (move) instead of copy. Default: false |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full burden. It mentions 'copy/paste' and 'cut' in parameters, implying file modification, but doesn't disclose critical behaviors like whether it creates backups, handles errors, requires file permissions, or has side effects. For a file manipulation tool with zero annotation coverage, this is inadequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise with two sentences that directly address the tool's function. Every word earns its place, and it's front-loaded with the core purpose. No wasted verbiage or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a file manipulation tool with 3 parameters (including nested objects), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on behavior, error handling, return values, and practical usage scenarios, leaving significant gaps for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 33% (low), but the description adds minimal value beyond the schema. It mentions 'Find content by search pattern, insert at marker location,' which loosely maps to source.start_pattern and target.marker, but doesn't explain parameter interactions, defaults, or edge cases. The description partially compensates for low schema coverage but not sufficiently.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Copy/paste content between files using text patterns.' It specifies the verb (copy/paste), resource (content between files), and mechanism (text patterns). However, with no sibling tools provided, it cannot demonstrate differentiation from alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, prerequisites, or constraints. It only describes what the tool does, not when it's appropriate. With no sibling tools, it cannot offer comparative advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
copy_paste
TDQS
Scored across 1 tool
With only one tool, there is no possibility of ambiguity or overlap between tools. The single tool 'copy_paste' has a clear, distinct purpose described as copying and pasting content between files using text patterns.
Since there is only one tool, naming consistency is inherently perfect. The tool name 'copy_paste' follows a clear verb-based pattern (copy and paste), and there are no other tools to compare it against for inconsistency.
A single tool is generally too few for a server's purpose, as it limits functionality and may indicate an incomplete or overly narrow scope. For a clipboard server, one might expect additional tools like 'cut', 'clear', or operations on different data types, making this count insufficient for robust coverage.
The server's domain appears to be clipboard operations, but with only one tool for copy/paste, there are significant gaps. Missing operations likely include cutting, clearing, or handling clipboard history, which are common in clipboard functionality, leading to an incomplete surface that could cause agent failures.
Maintenance
Related MCP Connectors
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Shared memory for coding agents. Stop re-explaining your codebase every session.
Project memory, semantic code search, and grounded agent context.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides clipboard-style operations for AI coding agents to cut, copy, paste, and undo code blocks across files with session management and audit trail. Enables efficient code refactoring and boilerplate distribution through line-based file operations.12 npm2MIT
- AlicenseAqualityNot gradedmaintenanceEnables agents to quickly find and edit code in a codebase with surgical precision. Find symbols, edit them everywhere with tools for reading code blocks, searching/replacing text, and making precise line-based modifications.311 npm-
- AlicenseAqualityBmaintenanceEnables LLMs to efficiently navigate and analyze large diff files by providing pattern-based chunk navigation, allowing direct access to relevant changes without loading entire diffs into context.58MIT

Code Scalpelofficial
AlicenseNot gradedqualityCmaintenanceEnables AI assistants to surgically extract and analyze code, reducing token usage and costs by up to 200x compared to reading entire files.18MIT