opencode-tools-mcp-server
v1.0.0
Published
MCP server providing OpenCode tools - file operations, bash, web search, code search, and more
Maintainers
Readme
opencode-tools-mcp-server
A Model Context Protocol (MCP) server providing comprehensive file operations, bash execution, web search, code search, and more.
Installation
Using npx (recommended)
{
"mcpServers": {
"opencode-tools": {
"command": "npx",
"args": ["-y", "opencode-tools-mcp-server"]
}
}
}Global installation
npm install -g opencode-tools-mcp-serverThen configure:
{
"mcpServers": {
"opencode-tools": {
"command": "opencode-tools"
}
}
}Available Tools
File Operations
| Tool | Description |
|------|-------------|
| read | Read files or directories with pagination support |
| write | Write content to files |
| edit | Edit files with smart string replacement (9 replacer strategies) |
| multiedit | Perform multiple edits in sequence |
| glob | Find files using glob patterns |
| grep | Search file contents using regex |
| ls | List directory contents in tree format |
Execution
| Tool | Description |
|------|-------------|
| bash | Execute shell commands with timeout support |
Web Operations
| Tool | Description |
|------|-------------|
| webfetch | Fetch web content (HTML, Markdown, images) |
| websearch | Search the web using Exa API |
| codesearch | Search for code examples using Exa API |
Task Management
| Tool | Description |
|------|-------------|
| todowrite | Write/update todo list |
| todoread | Read current todo list |
| task | Create sub-agent tasks |
| batch | Execute multiple tool calls in parallel |
Other Tools
| Tool | Description |
|------|-------------|
| apply_patch | Apply patch files |
| question | Ask user questions |
| lsp | LSP operations (definition, references, hover, etc.) |
| set_working_directory | Set the working directory for file operations |
Features
Smart Edit Replacement
The edit tool includes 9 intelligent replacement strategies:
- SimpleReplacer - Direct string matching
- LineTrimmedReplacer - Match with trimmed lines
- BlockAnchorReplacer - Match using first/last line anchors with Levenshtein similarity
- WhitespaceNormalizedReplacer - Normalize whitespace for matching
- IndentationFlexibleReplacer - Ignore indentation differences
- EscapeNormalizedReplacer - Handle escape sequences
- TrimmedBoundaryReplacer - Match trimmed boundaries
- ContextAwareReplacer - Use context for matching
- MultiOccurrenceReplacer - Handle multiple occurrences
File Reading Features
- Automatic binary file detection
- Image and PDF support (returns base64)
- Line truncation for long lines
- Byte limit enforcement
- File suggestions when file not found
Web Operations
- HTML to Markdown conversion
- Image fetching support
- Configurable timeouts
- Accept header negotiation
Configuration Example
For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "opencode-mcp-server"]
}
}
}For other MCP clients, adjust the configuration accordingly.
Requirements
- Node.js >= 18.0.0
License
MIT
