Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

AI Agents

The Solidity language server works with AI coding agents. Each agent integrates differently — some connect directly to the LSP, others rely on configuration files and tool access.

Comparison

AgentLSP IntegrationConfig FileDiagnosticsCode Intelligence
OpenCodeDirect (built-in)opencode.jsonAutomatic via LSPHover, definition, references, symbols, call hierarchy
Claude CodeVia pluginCLAUDE.mdAutomatic via LSPHover, definition, references, symbols, call hierarchy
CodexNoneAGENTS.mdVia forge build / shellTerminal commands, test harnesses

How it works

With LSP (OpenCode)

OpenCode connects directly to solidity-language-server over stdio. The AI agent receives real-time diagnostics, can query hover info for type signatures and NatSpec docs, jump to definitions, find references, and trace call hierarchies — all through standard LSP methods.

With LSP Plugin (Claude Code)

Claude Code supports LSP through its plugin system. Install the solidity-language-server plugin to get full LSP integration — hover, go-to-definition, references, symbols, and call hierarchy — all through the LSP tool.

Without LSP (Codex)

Codex doesn't have built-in LSP support. Instead, it relies on:

  • Instruction files (AGENTS.md) that tell the AI how to work with your Solidity project
  • Shell commands (forge build, forge test) to get compiler diagnostics
  • File tools to read and edit source code directly

The instruction files should describe your project structure, how to build and test, and any conventions the AI should follow.