Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .devcontainer/opencode-seed/commands/to-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ agent: build

# to-markdown

Convert source content into Markdown using MarkItDown.
Convert source content into Markdown using MarkItDown CLI (fallback when MCP is unavailable).

## Usage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
When users ask to read, summarize, or analyze non-Markdown sources (PDF, DOCX, PPTX, HTML, image-derived text, or URLs), first convert the source with `/to-markdown`.
When users ask to read, summarize, or analyze non-Markdown sources (PDF, DOCX, PPTX, HTML, image-derived text, or URLs), first convert the source with the `markitdown` MCP tool (`convert_to_markdown`).

Guidelines:
- Prefer MCP conversion first; use `/to-markdown` only as a fallback when MCP is unavailable.
- Prefer `/to-markdown <input> <output.md>` for large inputs.
- If `<input>` is a directory, never use `Read File` on that directory path; run `/to-markdown <input-dir> <output-dir>` instead.
- For small inputs, `/to-markdown <input>` and return inline Markdown is acceptable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ Use this skill when you need to transform non-Markdown sources (PDF, Office docs
## OpenChamber Usage

1. Explicit command:
- Use MCP tool `markitdown.convert_to_markdown(uri)` first
- `/to-markdown <input> [output.md]`
2. Natural language:
- Ask normally (e.g. "このPDFをMarkdown化して"), then route through `/to-markdown`
- Ask normally (e.g. "このPDFをMarkdown化して"), then route through MCP `convert_to_markdown`

## Notes

Expand Down
24 changes: 24 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,20 @@ if command -v uv &> /dev/null; then
fi
fi

MARKITDOWN_MCP_MARKER="/home/vscode/.local/share/uv/tools/markitdown-mcp/.ecc-installed"
if command -v uv &> /dev/null; then
if ! command -v markitdown-mcp &> /dev/null || [[ ! -f "$MARKITDOWN_MCP_MARKER" ]]; then
echo "🧩 markitdown-mcp をインストール中..."
if uv tool install --upgrade markitdown-mcp; then
mkdir -p "$(dirname "$MARKITDOWN_MCP_MARKER")"
touch "$MARKITDOWN_MCP_MARKER"
echo " ✅ markitdown-mcp インストール完了"
else
echo " ⚠️ markitdown-mcp インストールに失敗しました"
fi
fi
fi

# ECC の設定適用
echo " ECC設定を適用中..."

Expand Down Expand Up @@ -161,6 +175,16 @@ cat > ~/.opencode/opencode.json << 'EOF'
"model": "anthropic/claude-sonnet-4-5",
"small_model": "anthropic/claude-haiku-4-5",
"default_agent": "build",
"mcp": {
"markitdown": {
"type": "local",
"command": [
"/home/vscode/.local/bin/markitdown-mcp"
],
"enabled": true,
"timeout": 30000
}
},
"plugin": [
"./plugins"
]
Expand Down
27 changes: 26 additions & 1 deletion .devcontainer/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,20 @@ if command -v uv >/dev/null 2>&1; then
fi
fi

MARKITDOWN_MCP_MARKER="/home/vscode/.local/share/uv/tools/markitdown-mcp/.ecc-installed"
if command -v uv >/dev/null 2>&1; then
if ! command -v markitdown-mcp >/dev/null 2>&1 || [ ! -f "$MARKITDOWN_MCP_MARKER" ]; then
echo "📦 markitdown-mcp を uv でインストール中..."
if uv tool install --upgrade markitdown-mcp >/tmp/markitdown-mcp-install.log 2>&1; then
mkdir -p "$(dirname "$MARKITDOWN_MCP_MARKER")"
touch "$MARKITDOWN_MCP_MARKER"
echo "✅ markitdown-mcp インストール完了"
else
echo "⚠️ markitdown-mcp インストール失敗 (ログ: /tmp/markitdown-mcp-install.log)"
fi
fi
fi

if [ -f /home/vscode/.opencode/opencode.json ]; then
python3 - <<'PY'
import json
Expand All @@ -248,7 +262,18 @@ entry = "instructions/markitdown-converter.md"
if entry not in instructions:
instructions.append(entry)
config["instructions"] = instructions
path.write_text(json.dumps(config, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")

mcp = config.get("mcp", {})
if "markitdown" not in mcp:
mcp["markitdown"] = {
"type": "local",
"command": ["/home/vscode/.local/bin/markitdown-mcp"],
"enabled": True,
"timeout": 30000,
}
config["mcp"] = mcp

path.write_text(json.dumps(config, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
PY
fi

Expand Down
Loading