Determine the Authentication Method
- Decide which authentication your target REST API requires:
- Basic Authentication (username and password)
- Bearer Token (single token)
- API Key (header name and value)
Obtain the Necessary Credentials:
- For Basic Authentication:
- Sign up or log into your target REST API service.
- Create or locate your API username and password.
- For Bearer Token:
- Log into the admin console or developer portal of your API service.
- Generate or copy your API Bearer Token (sometimes called an access token or personal token).
- For API Key:
- Log into your API provider’s dashboard.
- Go to the “API Keys”, “Access Tokens”, or “Credentials” section.
- Generate a new API Key or use an existing one.
- Note both the header name (e.g.,
X-API-Key
) and the key value.
Gather Your REST API Base URL
- Identify the base URL for your API (e.g.,
https://api.example.com
).
- This is usually provided in your API’s documentation.
(Optional) Decide on Custom Headers or SSL Settings
- If your API requires custom headers, note the names and values.
- If using self-signed certificates, decide if SSL verification should be disabled.
Fill in Values in the FastMCP Connection Interface
- Click the "Install Now" button for the server.
- In the FastMCP interface, fill in the following environment variables as needed:
REST_BASE_URL
: Paste your API base URL.
- For Basic Auth:
AUTH_BASIC_USERNAME
: Your username
AUTH_BASIC_PASSWORD
: Your password
- For Bearer Token:
AUTH_BEARER
: Your bearer token
- For API Key:
AUTH_APIKEY_HEADER_NAME
: API key header name (e.g., X-API-Key
)
AUTH_APIKEY_VALUE
: API key value
- (Optional)
REST_ENABLE_SSL_VERIFY
: Set to "false" if skipping SSL verification.
- (Optional) Custom headers, prefixed with
HEADER_
(e.g., HEADER_X-API-Version
)
Save and Apply
- Save the configuration.
- Restart the MCP server if prompted or if configuration changes do not appear immediately.
Note: Only configure one authentication method at a time. If you don’t know what your API uses, refer to your REST API’s documentation or support resources for details.