OpenHands

Customize OpenHands with skills, AGENTS.md, setup.sh and MCP

How do I give OpenHands repository instructions, keyword-triggered knowledge, a setup script and MCP servers?

OpenHands now calls microagents skills, and new skills go in .agents/skills/SKILL_NAME/SKILL.md, while the legacy .openhands/skills and .openhands/microagents folders still work. AGENTS.md at the repository root is always loaded as repository context, and skills with a triggers list load only when a keyword appears. A .openhands/setup.sh script prepares the environment, and MCP servers are managed in the UI or with openhands mcp add, not in config.toml.

AGENTS.md and the skills directory

AGENTS.md at the repository root is included in the initial system prompt. Keep it short: the purpose of the repo, how to set it up, its structure, and the CI checks it must pass. OpenHands also recognizes CLAUDE.md and GEMINI.md as model specific repository context.

  • Repository skills: .agents/skills/SKILL_NAME/SKILL.md (recommended for new skills).
  • Legacy paths .openhands/skills and .openhands/microagents are still supported.
  • User skills: ~/.agents/skills, available in all of that user's conversations.
  • The skill name in the frontmatter must match its parent directory name.

.agents/skills/release-checklist/SKILL.md

---
name: release-checklist
description: Prepare and verify a release checklist. Use when creating release notes or publishing a release.
---

Check the version, changelog, validation commands, and release notes before publishing.

Keyword-triggered skills

Add a triggers list to the frontmatter and the skill loads only when one of those words appears in a message. This keeps specialized guidance, such as GitHub or GitLab instructions, out of the context until it is needed.

.agents/skills/github/SKILL.md

---
name: github
description: How to work with the GitHub API in this environment.
triggers:
- github
- git
---

You have access to an environment variable, GITHUB_TOKEN, which allows you to interact with the GitHub API.

setup.sh and hooks

Put a setup.sh script in the .openhands directory at the repository root. It runs whenever OpenHands starts working with the repository, so use it to set environment variables and install dependencies.

.openhands/setup.sh

#!/bin/bash
export MY_ENV_VAR="my value"
sudo apt-get update
sudo apt-get install -y lsof
cd frontend && npm install ; cd ..

A .openhands/hooks.json file can run scripts at key points, for example to block dangerous commands or log tool use. Stop hooks can block task completion until formatting, linting or tests pass, and the docs say checks in the older pre-commit.sh should move to Stop hooks.

MCP servers and the CLI

Current OpenHands releases do not read MCP servers from config.toml; that format was for the legacy V0 version. Add servers in the UI under Customize, then MCP Servers, or with the CLI, which writes them to ~/.openhands/mcp.json.

Install and manage MCP servers

uv tool install openhands --python 3.12
openhands
openhands mcp add YOUR_NAME --transport http YOUR_SERVER_URL
openhands mcp add YOUR_NAME --transport stdio --env "KEY=YOUR_VALUE" YOUR_COMMAND -- YOUR_ARGS
openhands mcp list
openhands mcp remove YOUR_NAME

~/.openhands/mcp.json

{
  "mcpServers": {
    "server-name": {
      "command": "command-to-run",
      "args": ["arg1", "arg2"],
      "env": {
        "ENV_VAR": "value"
      }
    }
  }
}

The CLI needs Python 3.12 or newer. On first launch it walks you through LLM settings, which it stores in ~/.openhands/settings.json.

Sources

More on OpenHands

Other guides

Cursor: allow all terminal commandsClaude Code: allow commands without promptsCodex CLI: approval and sandbox modesGemini CLI: YOLO mode, auto_edit and allowing specific shell commandsCursor Privacy Mode: telemetry, training and data retentionClaude Code telemetry and data retention: what is sent and how to turn it offGemini CLI: turn off usage statistics and telemetryCLAUDE.md: where it goes, how it loads, and how it works with AGENTS.mdClaude Code hooks: format on save, block risky edits, get notifiedClaude Code subagents: create one, limit its tools, and call itAdd MCP servers to Cursor with mcp.json: Keep files out of Cursor with .cursorignore: Configure Codex with config.toml: Configure Gemini CLI with settings.json: Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes): Claude Code custom slash commands and skills (SKILL.md): GitHub Copilot custom instructions: Adding MCP servers to GitHub Copilot: Claude Code settings.json: file locations, precedence, and key settingsClaude Code plugins and marketplaces: install, create, and shareGemini CLI extensions and custom commands: Configuring OpenCode with opencode.json: Cline Rules: workspace, global, and conditional rulesKiro steering files: .kiro/steering, inclusion modes, and AGENTS.mdZed agent: instruction files, MCP servers, tool permissions, and ACP agentsCursor CLI: install, headless mode, permissions and CIAider: CONVENTIONS.md, .aider.conf.yml and API keysJunie guidelines, MCP and the Action Allowlist: Amp AGENTS.md, settings.json and MCP: Configure Goose extensions, hints, recipes and permissions: Configure Factory Droid CLI: AGENTS.md, settings.json, autonomy, custom droids and MCPConfigure Qwen Code: settings.json, providers, QWEN.md, MCP and approval modes

Get the weekly agent stack update

New official MCP servers, spec changes and harness releases, checked against the source. One email a week, no fluff.

Reviewed Oct 6, 2026. Settings change often; the linked vendor docs are the source of truth.