Skip to main content
Glama
purpleax

Fastly NGWAF MCP Server

by purpleax

set_credentials

Configure API credentials for the Fastly Next-Gen Web Application Firewall to enable security management through AI assistants.

Instructions

Set Fastly NGWAF API credentials (email and access token)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesYour Fastly NGWAF email address
tokenYesYour Fastly NGWAF API access token

Implementation Reference

  • MCP tool handler for 'set_credentials': instantiates FastlyNGWAFClient, sets credentials via client.setCredentials(), tests connection with testConnection(), and prepares result with success/validation info.
    case 'set_credentials': client = new FastlyNGWAFClient(); result = client.setCredentials(typedArgs.email, typedArgs.token); // Test the connection to validate the credentials try { const connectionTest = await client.testConnection(); result.message = `Credentials set and validated successfully. Access to ${connectionTest.corporationsCount} corporations.`; result.email = connectionTest.email; } catch (error) { result.success = false; result.error = error.message; } break;
  • Tool definition including name, description, and input schema (JSON Schema object with required email and token strings). Used for registration in ListTools response.
    name: 'set_credentials', description: 'Set Fastly NGWAF API credentials (email and access token)', inputSchema: { type: 'object', properties: { email: { type: 'string', description: 'Your Fastly NGWAF email address' }, token: { type: 'string', description: 'Your Fastly NGWAF API access token' }, }, required: ['email', 'token'], }, },
  • FastlyNGWAFClient.setCredentials method: stores email/token instance properties and sets axios default headers for authentication.
    setCredentials(email, token) { this.email = email; this.token = token; this.api.defaults.headers.common['x-api-user'] = email; this.api.defaults.headers.common['x-api-token'] = token; return { success: true, authenticated: true };
  • server.js:814-816 (registration)
    Registers the list tools handler which returns the tools array containing 'set_credentials' definition.
    server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/purpleax/FastlyMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server