LLM tools for API discovery from .mind spec files. Works with .mind files generated by spec-mind.
LLMs interacting with HTTP APIs need to discover endpoints, understand contracts, and make requests. api-mind provides 3 tools for discovery and context:
- list_apis - Discover available APIs
- list_endpoints - Find endpoints across APIs
- get_endpoint_schema - Get base URL, auth requirements, and schema
The LLM then constructs and executes curl commands via the bash tool with full transparency.
# Project-level (recommended)
curl -sSL https://raw.githubusercontent.com/msegoviadev/api-mind/main/install.sh | bash
# Global (user-wide, available for all projects)
curl -sSL https://raw.githubusercontent.com/msegoviadev/api-mind/main/install.sh | bash -s -- --globalThe script will:
- Add
@msegoviadev/api-mindto youropencode.json - Download
API-MIND.mdto the appropriate location - Add
@API-MIND.mdreference to yourAGENTS.md
Click to expand manual installation steps
Add @msegoviadev/api-mind to your opencode.json or opencode.jsonc:
{
"plugin": ["@msegoviadev/api-mind"]
}OpenCode will automatically install the plugin from npm on startup.
Run this command in your project root:
curl -sSL https://raw.githubusercontent.com/msegoviadev/api-mind/main/API-MIND.md -o API-MIND.mdAdd this line to your AGENTS.md:
@API-MIND.md-
Place OpenAPI specs in
specs/folder:specs/ api1.yaml api2.yaml -
Generate
.mindfiles using spec-mind:spec-mind sync --no-notation ./specs/
-
Commit
.mindfiles alongside source specs:specs/ api1.yaml api1.mind # generated api2.yaml api2.mind # generated -
Tools automatically load from
specs/*.mind
By default, api-mind looks for .mind files in the specs/ directory.
To customize the specs location, create an api-mind.json file in your project root:
{
"specsDir": "documentation/api-specs"
}The path is relative to your project root (where you run opencode).
Lists all APIs loaded from the specs folder.
Input: none
Output: JSON with API names, titles, base URLs, and environments
Call first to discover what APIs are available.
Lists endpoints across all APIs.
Input:
filter (optional): Substring match on method, path, or section
Output: JSON with environments and endpoint list
Call to find specific endpoints.
Returns full context for an endpoint.
Input:
api: API name
method: HTTP method
path: Endpoint path
Output: Text block with base URL, environments, auth, and schema
Call before constructing curl to understand the endpoint.
list_apis → list_endpoints → get_endpoint_schema → [LLM constructs curl] → bash
list_apis- Discover available APIslist_endpoints- Find relevant endpointsget_endpoint_schema- Get context (URL, auth, schema)- LLM constructs curl command with proper URL and headers
- LLM executes via
bashtool
When get_endpoint_schema shows auth requirements, construct headers:
| Auth in Schema | curl Header |
|---|---|
None |
No header |
bearer |
-H 'Authorization: Bearer <TOKEN>' |
oauth2 <scopes> |
-H 'Authorization: Bearer <TOKEN>' |
api_key <header> |
-H '<header>: <KEY>' |
basic |
-H 'Authorization: Basic <base64>' |
- spec-mind - Generate
.mindfiles from OpenAPI specs
bun run buildFor local testing without publishing, create a symlink in your test project:
# In your test project
mkdir -p .opencode/plugins
ln -s /path/to/api-mind/src/index.ts .opencode/plugins/api-mind.ts
ln -s /path/to/api-mind/API-MIND.md API-MIND.mdMIT