
HAL (HTTP API Layer)
Converts OpenAPI/Swagger specifications into HTTP tools that AI models can use to make secure API requests with automatic secret management.
Transforms OpenAPI/Swagger specifications into dynamic HTTP tools with secret management and URL restrictions, enabling secure API integration through automatic tool generation from API documentation.
What it does
- Make HTTP GET/POST/PUT/PATCH/DELETE requests with secret substitution
- Generate API tools automatically from OpenAPI/Swagger specs
- Manage API secrets through environment variables
- Check available HTTP methods with OPTIONS requests
- List configured secret keys without exposing values
Best for
About HAL (HTTP API Layer)
HAL (HTTP API Layer) is a community-built MCP server published by deanward that provides AI assistants with tools and capabilities via the Model Context Protocol. Transform OpenAPI specification into secure, dynamic HTTP tools with secret management for seamless API integration. Pow It is categorized under developer tools. This server exposes 8 tools that AI clients can invoke during conversations and coding sessions.
How to install
You can install HAL (HTTP API Layer) in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
License
HAL (HTTP API Layer) is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
Tools (8)
Make an HTTP GET request to a specified URL. Supports secret substitution using {secrets.key} syntax where 'key' corresponds to HAL_SECRET_KEY environment variables.
Make an HTTP POST request to a specified URL with optional body and headers. Supports secret substitution using {secrets.key} syntax in URL, headers, and body where 'key' corresponds to HAL_SECRET_KEY environment variables.
Make an HTTP PUT request to a specified URL with optional body and headers. Supports secret substitution using {secrets.key} syntax in URL, headers, and body where 'key' corresponds to HAL_SECRET_KEY environment variables.
Make an HTTP PATCH request to a specified URL with optional body and headers. Supports secret substitution using {secrets.key} syntax in URL, headers, and body where 'key' corresponds to HAL_SECRET_KEY environment variables.
Make an HTTP DELETE request to a specified URL with optional headers. Supports secret substitution using {secrets.key} syntax in URL and headers where 'key' corresponds to HAL_SECRET_KEY environment variables.
HAL (HTTP API Layer)
HAL is a Model Context Protocol (MCP) server that provides HTTP API capabilities to Large Language Models. It allows LLMs to make HTTP requests and interact with web APIs through a secure, controlled interface. HAL can also automatically generate tools from OpenAPI/Swagger specifications for seamless API integration.
Documentation
Visit our comprehensive documentation site for detailed guides, examples, and API reference.
Features
- HTTP GET/POST/PUT/PATCH/DELETE/OPTIONS/HEAD Requests: Fetch and send data to any HTTP endpoint
- Secure Secret Management: Environment-based secrets with
{secrets.key}substitution and automatic redaction - Swagger/OpenAPI Integration: Automatically generate tools from API specifications
- Built-in Documentation: Self-documenting API reference
- Secure: Runs in isolated environment with controlled access
- Fast: Built with TypeScript and optimized for performance
Usage
HAL is designed to work with MCP-compatible clients. Here are some examples:
Basic Usage (Claude Desktop)
Add HAL to your Claude Desktop configuration (npx will automatically install and run HAL):
{
"mcpServers": {
"hal": {
"command": "npx",
"args": ["hal-mcp"]
}
}
}
With Swagger/OpenAPI Integration and Secrets
To enable automatic tool generation from an OpenAPI specification and use secrets:
{
"mcpServers": {
"hal": {
"command": "npx",
"args": ["hal-mcp"],
"env": {
"HAL_SWAGGER_FILE": "/path/to/your/openapi.json",
"HAL_API_BASE_URL": "https://api.example.com",
"HAL_SECRET_API_KEY": "your-secret-api-key",
"HAL_SECRET_USERNAME": "your-username",
"HAL_SECRET_PASSWORD": "your-password"
}
}
}
}
URL-based Configuration
You can also load OpenAPI specs directly from URLs:
{
"mcpServers": {
"hal": {
"command": "npx",
"args": ["hal-mcp"],
"env": {
"HAL_SWAGGER_FILE": "/swagger/v1/swagger.json",
"HAL_API_BASE_URL": "http://localhost:5065",
"HAL_SECRET_API_KEY": "your-secret-api-key"
}
}
}
}
Direct Usage
# Start the HAL server with default tools
npx hal-mcp
# Or with Swagger/OpenAPI integration
HAL_SWAGGER_FILE=/path/to/api.yaml HAL_API_BASE_URL=https://api.example.com npx hal-mcp
# Or load from URL
HAL_SWAGGER_FILE=/swagger/v1/swagger.json HAL_API_BASE_URL=http://localhost:5065 npx hal-mcp
Configuration
HAL supports the following environment variables:
HAL_SWAGGER_FILE: Path or URL to OpenAPI/Swagger specification file (JSON or YAML format). Can be:- Local file path:
/path/to/api.yaml - Full URL:
https://api.example.com/swagger.json - Relative path:
/swagger/v1/swagger.json(combined withHAL_API_BASE_URL)
- Local file path:
HAL_API_BASE_URL: Base URL for API requests (overrides the servers specified in the OpenAPI spec)HAL_SECRET_*: Secret values for secure substitution in requests (e.g.,HAL_SECRET_TOKEN=abc123)HAL_ALLOW_*: URL restrictions for namespaced secrets (e.g.,HAL_ALLOW_MICROSOFT="https://azure.microsoft.com/*")HAL_WHITELIST_URLS: Comma-separated list of URL patterns that are allowed (if set, only these URLs are permitted)HAL_BLACKLIST_URLS: Comma-separated list of URL patterns that are blocked (if set, these URLs are denied)
Secret Management
HAL provides secure secret management to keep sensitive information like API keys, tokens, and passwords out of the conversation while still allowing the AI to use them in HTTP requests.
How It Works
-
Environment Variables: Define secrets using the
HAL_SECRET_prefix:HAL_SECRET_API_KEY=your-secret-api-key HAL_SECRET_TOKEN=your-auth-token HAL_SECRET_USERNAME=your-username -
Template Substitution: Reference secrets in your requests using
{secrets.key}syntax:- URLs:
https://api.example.com/data?token={secrets.token} - Headers:
{"Authorization": "Bearer {secrets.api_key}"} - Request Bodies:
{"username": "{secrets.username}", "password": "{secrets.password}"}
- URLs:
-
Security: The AI never sees the actual secret values, only the template placeholders. Values are substituted at request time.
Automatic Secret Redaction
HAL automatically redacts secret values from all responses sent back to the AI, providing an additional layer of security against credential exposure.
How It Works
- Secret Tracking: HAL maintains a registry of all secret values from environment variables
- Response Scanning: All HTTP responses (headers, bodies, error messages) are scanned for secret values
- Automatic Replacement: Any occurrence of actual secret values is replaced with
[REDACTED]before sending to the AI - Comprehensive Coverage: Redaction applies to:
- Error messages (including URL parsing errors that might expose credentials)
- Response headers (in case APIs echo back authentication data)
- Response bodies (protecting against API responses that might include sensitive data)
- All other text returned to the AI
Example Protection
Before (vulnerable):
Error: Request cannot be constructed from a URL that includes credentials:
https://65GQiI8-1JCOWV1KAuYr0g:[email protected]/api/v1/access_token
After (secure):
Error: Request cannot be constructed from a URL that includes credentials:
https://[REDACTED]:[REDACTED]@www.reddit.com/api/v1/access_token
This protection is automatic and requires no configuration - HAL will redact any secret values regardless of how they appear in responses, ensuring that even if an API or error message attempts to expose credentials, the AI never sees the actual values.
Namespaces and URL Restrictions
HAL supports organizing secrets into namespaces and restricting them to specific URLs for enhanced security:
Namespace Convention
Use - for namespace separators and _ for word separators within keys:
# Single namespace
HAL_SECRET_MICROSOFT_API_KEY=your-api-key
# Usage: {secrets.microsoft.api_key}
# Multi-level namespaces
HAL_SECRET_AZURE-STORAGE_ACCESS_KEY=your-storage-key
HAL_SECRET_AZURE-COGNITIVE_API_KEY=your-cognitive-key
HAL_SECRET_GOOGLE-CLOUD-STORAGE_SERVICE_ACCOUNT_KEY=your-service-key
# Usage: {secrets.azure.storage.access_key}
# Usage: {secrets.azure.cognitive.api_key}
# Usage: {secrets.google.cloud.storage.service_account_key}
URL Restrictions
Restrict namespaced secrets to specific URLs using HAL_ALLOW_* environment variables:
# Restrict Microsoft secrets to Microsoft domains
HAL_SECRET_MICROSOFT_API_KEY=your-api-key
HAL_ALLOW_MICROSOFT="https://azure.microsoft.com/*,https://*.microsoft.com/*"
# Restrict Azure Storage secrets to Azure storage endpoints
HAL_SECRET_AZURE-STORAGE_ACCESS_KEY=your-storage-key
HAL_ALLOW_AZURE-STORAGE="https://*.blob.core.windows.net/*,https://*.queue.core.windows.net/*"
# Multiple URLs are comma-separated
HAL_SECRET_GOOGLE-CLOUD_API_KEY=your-google-key
HAL_ALLOW_GOOGLE-CLOUD="https://*.googleapis.com/*,https://*.googlecloud.com/*"
How Parsing Works
Understanding how environment variable names become template keys:
HAL_SECRET_AZURE-STORAGE_ACCESS_KEY
│ │ │
│ │ └─ Key: "ACCESS_KEY" → "access_key"
│ └─ Namespace: "AZURE-STORAGE" → "azure.storage"
└─ Prefix
Final template: {secrets.azure.storage.access_key}
Step-by-step breakdown:
- Remove
HAL_SECRET_prefix →AZURE-STORAGE_ACCESS_KEY - Split on first
_→ Namespace:AZURE-STORAGE, Key:ACCESS_KEY - Transform namespace:
AZURE-STORAGE→azure.storage(dashes become dots, lowercase) - Transform key:
ACCESS_KEY→access_key(underscores stay, lowercase) - Combine:
{secrets.azure.storage.access_key}
More Examples
# Simple namespace
HAL_SECRET_GITHUB_TOKEN=your_token
→ {secrets.github.token}
# Two-level namespace
HAL_SECRET_AZURE-COGNITIVE_API_KEY=your_key
→ {secrets.azure.cognitive.api_key}
# Three-level namespace
HAL_SECRET_GOOGLE-CLOUD-STORAGE_SERVICE_ACCOUNT=your_account
→ {secrets.google.cloud.storage.service_account}
# Complex key with underscores
HAL_SECRET_AWS-S3_BUCKET_ACCESS_KEY_ID=your_id
→ {secrets.aws.s3.bucket_access_key_id}
# No namespace (legacy style)
HAL_SECRET_API_KEY=your_key
→ {secrets.api_key}
Visual Guide: Complete Flow
Environment Variable Template Usage URL Restriction
├─ HAL_SECRET_MICROSOFT_API_KEY ├─ {secrets.microsoft.api_key} ├─ HAL_ALLOW_MICROSOFT
├─ HAL_SECRET_AZURE-STORAGE_KEY ├─ {secrets.azure.storage.key} ├─ HAL_ALLOW_AZURE-STORAGE
├─ HAL_SECRET_AWS-S3_ACCESS_KEY ├─ {secrets.aws.s3.access_key} ├─ HAL_ALLOW_AWS-S3
└─ HAL_SECRET_UNRESTRICTED_TOKEN └─ {secrets.unrestricted.token} └─ (no restriction)
Security Benefits
- Principle of Least Privilege: Secrets only work with their intended services
- Prevents Cross-Service Leakage: Azure secrets can't be sent to AWS APIs
- Defense in Depth: Even with AI errors or prompt injection, secrets are constrained
- Clear Organization: Namespace structure makes secret management more intuitive
Real-World Usage Scenarios
Scenario 1: Multi-Cloud Application
# Azure services
HAL_SECRET_AZURE-STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;...
HAL_SECRET_AZURE-COGNITIVE_SPEECH_KEY=abcd1234...
HAL_ALLOW_AZURE-STORAGE="https://*.blob.core.windows.net/*,https://*.queue.core.windows.net/*"
HAL_ALLOW_AZURE-COGNITIVE="https://*.cognitiveservices.azure.com/*"
# AWS services
HAL_SECRET_AWS-S3_ACCESS_KEY=AKIA...
HAL_SECRET_AWS-LAMBDA_API_KEY=lambda_key...
HAL
---
*README truncated. [View full README on GitHub](https://github.com/deanward/hal).*
Alternatives
Related Skills
Browse all skillsCreate, edit, and export live Excalidraw diagrams using mcp-excalidraw-server (MCP tools + canvas REST API). Use when an agent needs to draw/lay out diagrams, convert Mermaid to Excalidraw, query/update/delete elements, or export/import elements from a running canvas server (EXPRESS_SERVER_URL, default http://localhost:3000).
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.
Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.
Use when integrating with Tesla's official Fleet API to read vehicle/energy device data or issue remote commands (e.g. start HVAC preconditioning, wake vehicle, charge controls). Covers onboarding (developer app registration, regions/base URLs), OAuth token flows (third-party + partner tokens, refresh rotation), required domain/public-key hosting, and using Tesla's official vehicle-command/tesla-http-proxy for signed vehicle commands.
Play Pokemon Red autonomously via PyBoy emulator. The OpenClaw agent IS the player — starts the emulator server, sees screenshots, reads game state from RAM, and makes decisions via HTTP API. Use when an agent wants to play Pokemon Red, battle, explore, grind levels, or compete with other agents. Requires Python 3.10+, pyboy, and a legally obtained Pokemon Red ROM.
CCXT cryptocurrency exchange library for TypeScript and JavaScript developers (Node.js and browser). Covers both REST API (standard) and WebSocket API (real-time). Helps install CCXT, connect to exchanges, fetch market data, place orders, stream live tickers/orderbooks, handle authentication, and manage errors. Use when working with crypto exchanges in TypeScript/JavaScript projects, trading bots, arbitrage systems, or portfolio management tools. Includes both REST and WebSocket examples.