Set up OpenCode

Add the Veracity MCP server to OpenCode so your agent queries current Veracity documentation and API references inside your terminal.

Add the Veracity Development MCP Server to OpenCode so your agent can query official Veracity documentation and API references without leaving your terminal.

An MCP server is a service that exposes tools, prompts, and resources to an agent over the Model Context Protocol. The Veracity Development MCP Server exposes six tools (covering documentation search, document retrieval, and live API exploration) that give your agent access to current official Veracity documentation and API definitions.

Before you begin

  • OpenCode installed (npm i -g opencode-ai or via the OpenCode install script)
  • Network access to https://docs.veracity.com/mcp

Steps

Add the MCP server

OpenCode loads MCP server configuration from opencode.json (or opencode.jsonc) in the project root, or from ~/.config/opencode/opencode.json for a global configuration.

  1. Create or open opencode.json in your project root.
  2. Add the Veracity Docs server entry:
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "veracity-docs": {
      "type": "remote",
      "url": "https://docs.veracity.com/mcp",
      "enabled": true
    }
  }
}
  1. Save the file. OpenCode detects the server on the next invocation.

To make the server available across all your projects, add the same entry to ~/.config/opencode/opencode.json.

Add an instructions file

An AGENTS.md file gives OpenCode persistent project-level instructions. Adding a Veracity entry ensures the agent queries documentation tools for Veracity-related tasks automatically.

  1. Open or create AGENTS.md in your project root.
  2. Add the following section:
## Veracity documentation

When working with Veracity APIs, platform features, or authentication flows, query the veracity-docs MCP server before writing or modifying code. Available tools: search_Veracity_dev_docs, get_Veracity_doc_by_path, get_Veracity_doc_range, list_Veracity_platform_apis, get_Veracity_api_methods, get_Veracity_api_method.
  1. Save the file.

For instructions that apply across all projects, add the same content to ~/.config/opencode/AGENTS.md.

OpenCode also reads CLAUDE.md as a fallback if no AGENTS.md exists. If you already have a CLAUDE.md in your project from another agent, OpenCode will use it.

Verify the result

Ask the agent a question that requires current Veracity documentation, such as:

  • How do I add Veracity authentication to my .NET project?
  • Show me the Veracity API reference for tenant management

The agent invokes search_Veracity_dev_docs or get_Veracity_doc_by_path and applies the retrieved documentation to your question. If neither tool is invoked, confirm that opencode.json exists in your project root and contains valid JSON.

Troubleshooting

The server does not load Confirm that opencode.json is in the correct location and is valid JSON. Run opencode mcp list to verify registered servers and their status.

The agent answers without using the MCP tools Reference the server explicitly in your prompt: Use the veracity-docs MCP to find the current authentication guide.

The server URL is unreachable Verify network access to https://docs.veracity.com/mcp. If your organisation proxies outbound HTTPS, add the URL to your allow list.