Skip to content

Commit f088f00

Browse files
committed
Add comprehensive MCP loader documentation
- Added 'MCP LOADER (claude-code-mcp-loader)' section to src/features/AGENTS.md - Documented .mcp.json file locations with priority order (user, project, local) - Specified .mcp.json format with complete structure and examples - Documented server types (stdio, http, sse) with required fields - Added environment variable expansion syntax documentation - Provided practical examples for stdio, http, and disabled servers - Added transformation reference table for Claude Code → OpenCode format - Improved discoverability for users setting up MCP servers via Claude Code configuration 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent f64210c commit f088f00

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

src/features/AGENTS.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,116 @@ Disable features in `oh-my-opencode.json`:
7777
- **Timing**: PreToolUse, PostToolUse, UserPromptSubmit, Stop
7878
- **Format**: Returns `{ messages: [{ role: "user", content: "..." }] }`
7979

80+
## MCP LOADER (claude-code-mcp-loader)
81+
82+
Loads MCP server configs from `.mcp.json` files. Full Claude Code compatibility.
83+
84+
### File Locations (Priority Order)
85+
86+
| Path | Scope | Description |
87+
|------|-------|-------------|
88+
| `~/.claude/.mcp.json` | user | User-global MCP servers |
89+
| `./.mcp.json` | project | Project-specific MCP servers |
90+
| `./.claude/.mcp.json` | local | Local overrides (git-ignored) |
91+
92+
### .mcp.json Format
93+
94+
```json
95+
{
96+
"mcpServers": {
97+
"server-name": {
98+
"type": "stdio|http|sse",
99+
"command": "npx",
100+
"args": ["-y", "@anthropics/mcp-server-example"],
101+
"env": {
102+
"API_KEY": "${MY_API_KEY}"
103+
},
104+
"disabled": false
105+
}
106+
}
107+
}
108+
```
109+
110+
### Server Types
111+
112+
| Type | Required Fields | Description |
113+
|------|-----------------|-------------|
114+
| `stdio` (default) | `command`, `args?`, `env?` | Local subprocess MCP |
115+
| `http` | `url`, `headers?` | HTTP-based remote MCP |
116+
| `sse` | `url`, `headers?` | SSE-based remote MCP |
117+
118+
### Environment Variable Expansion
119+
120+
Supports `${VAR}` syntax in all string fields:
121+
122+
```json
123+
{
124+
"mcpServers": {
125+
"my-server": {
126+
"command": "node",
127+
"args": ["${HOME}/mcp-server/index.js"],
128+
"env": {
129+
"API_KEY": "${MY_API_KEY}",
130+
"DEBUG": "${DEBUG:-false}"
131+
}
132+
}
133+
}
134+
}
135+
```
136+
137+
### Examples
138+
139+
**stdio (Local subprocess)**:
140+
```json
141+
{
142+
"mcpServers": {
143+
"filesystem": {
144+
"command": "npx",
145+
"args": ["-y", "@anthropics/mcp-server-filesystem", "/path/to/dir"]
146+
}
147+
}
148+
}
149+
```
150+
151+
**http (Remote)**:
152+
```json
153+
{
154+
"mcpServers": {
155+
"remote-api": {
156+
"type": "http",
157+
"url": "https://mcp.example.com/api",
158+
"headers": {
159+
"Authorization": "Bearer ${API_TOKEN}"
160+
}
161+
}
162+
}
163+
}
164+
```
165+
166+
**Disable a server**:
167+
```json
168+
{
169+
"mcpServers": {
170+
"expensive-server": {
171+
"command": "...",
172+
"disabled": true
173+
}
174+
}
175+
}
176+
```
177+
178+
### Transformation
179+
180+
Claude Code format → OpenCode format:
181+
182+
| Claude Code | OpenCode |
183+
|-------------|----------|
184+
| `type: "stdio"` | `type: "local"` |
185+
| `type: "http\|sse"` | `type: "remote"` |
186+
| `command` + `args` | `command: [cmd, ...args]` |
187+
| `env` | `environment` |
188+
| `headers` | `headers` |
189+
80190
## SKILL MCP MANAGER
81191

82192
- **Purpose**: Manage MCP servers embedded in skill YAML frontmatter

0 commit comments

Comments
 (0)