OpenCode: OpenCode Custom Tools
Last updated: 2026-08-31
--- title: OpenCode Custom Tools and oh-my-openagent description: Create custom tools to extend OpenCode and explore the oh-my-openagent plugin ecosystem order: 19 lang: en
Custom tools and community plugins let OpenCode's capabilities expand infinitely.
1. What You Will Learn
- Custom tool development
- Tool registration and configuration
- oh-my-openagent community ecosystem
- Plugin installation and usage
2. Custom Tool Development
Via MCP (Recommended):
JSON
{
"mcp": {
"my-tool": {
"command": "node",
"args": ["./tools/my-tool-server.js"]
}
}
}
TypeScript MCP Server Template:
TYPESCRIPT
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new Server(
{ name: "my-tool", version: "1.0.0" },
{ capabilities: { tools: {} } }
);
server.setRequestHandler("tools/list", async () => ({
tools: [{
name: "my_custom_tool",
description: "Custom tool description",
inputSchema: {
type: "object",
properties: { input: { type: "string" } },
required: ["input"]
}
}]
}));
Python MCP Server also supported.
3. oh-my-openagent
oh-my-openagent is the community plugin ecosystem for OpenCode (like oh-my-zsh for Zsh).
BASH
git clone https://github.com/anomalyco/oh-my-openagent ~/.config/opencode/oh-my-openagent
Common plugins:
| Plugin | Function |
|---|---|
| git-enhanced | Enhanced Git operations |
| docker-helper | Docker container management |
| code-style | Code style checking and auto-fix |
| test-runner | Enhanced test running |
| doc-generator | Auto documentation generation |
| security-scanner | Security vulnerability scanning |
4. Community Ecosystem
| Project | Description |
|---|---|
| OpenCode | Core CLI tool |
| oh-my-openagent | Community plugins |
| MCP SDK | Tool development SDK |
| CC Switch | API config management |
❓ FAQ
Q Custom tools vs MCP servers?
A Custom tools are primarily implemented via MCP servers. MCP is the protocol standard; custom tools are the concrete implementation.
Q Is oh-my-openagent safe?
A Community plugins are maintained by open-source contributors. Review code before installing. Test in sandbox environments.
📖 Summary
- Custom tools developed via MCP servers
- TypeScript and Python supported
- oh-my-openagent is the community plugin ecosystem
- Plugins provide enhanced Git, Docker, code style features
- Prefer community plugins; custom develop only when needed
📝 Exercises
-
Basic: Install oh-my-openagent and enable a community plugin.
-
Intermediate: Develop a simple MCP server with a custom tool.
-
Advanced: Develop a practical custom tool (e.g., project template generator) and share with the community.