# akamai-developers/akamai-functions-mcp-server architecture

> Architecture diagram of the GitHub repository akamai-developers/akamai-functions-mcp-server, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akamai-developers/akamai-functions-mcp-server
- Repository: https://github.com/akamai-developers/akamai-functions-mcp-server

## Overview

This is an MCP server that lets an AI assistant inspect and manage Akamai Functions applications through the Spin `aka` CLI. The main workflow is an MCP tool request, tool-specific validation and dispatch, backend CLI execution, and a structured response. Capabilities also include account-wide app search, deployment and workspace linking, and MCP resources for local app context and the `spin aka` reference. Edges reflect the shown registration, method calls, and CLI execution; some README-listed capabilities are grouped where their implementation is in the same file.

Main entry points: [`internal/tools/registration.go`](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/registration.go) (Tool registration), [`internal/spin/backend.go`](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/spin/backend.go) (Backend interface), [`main.go`](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/main.go) (MCP server), [`internal/resources/resources.go`](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go) (Resource registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["MCP entry"]
  node_mcp_server["MCP server<br/>[main.go]"]
  node_tool_registration["Tool registration<br/>[registration.go]"]
end

subgraph group_tools["Tool capabilities"]
  node_account_tools["Account tools<br/>[accounts.go]"]
  node_app_inventory["App inventory<br/>[apps.go]"]
  node_app_operations["App operations<br/>[app.go]"]
  node_app_search["App search<br/>[search.go]"]
  node_tool_types["Tool responses<br/>[tools.go]"]
end

subgraph group_backend["Spin backend"]
  node_spin_backend["Backend interface<br/>[backend.go]"]
  node_spin_commands["Spin CLI adapter<br/>[spin.go]"]
end

subgraph group_resources["MCP resources"]
  node_resource_registration["Resource registration<br/>[resources.go]"]
  node_local_context["Local app context<br/>[resources.go]"]
  node_command_reference["Command reference<br/>[resources.go]"]
end

node_assistant(("AI assistant"))
node_spin_cli["Spin aka CLI"]

node_assistant -->|"sends MCP requests"| node_mcp_server
node_mcp_server -->|"registers tools"| node_tool_registration
node_mcp_server -->|"registers resources"| node_resource_registration
node_tool_registration -->|"dispatches account calls"| node_account_tools
node_tool_registration -->|"dispatches inventory calls"| node_app_inventory
node_tool_registration -->|"dispatches app calls"| node_app_operations
node_tool_registration -->|"dispatches search calls"| node_app_search
node_account_tools -->|"calls account methods"| node_spin_backend
node_app_inventory -->|"calls app listing"| node_spin_backend
node_app_operations -->|"calls app methods"| node_spin_backend
node_app_search -->|"lists accounts and apps"| node_spin_backend
node_spin_backend -->|"implemented by"| node_spin_commands
node_spin_commands -->|"executes commands"| node_spin_cli
node_resource_registration -->|"serves context"| node_local_context
node_resource_registration -->|"serves reference"| node_command_reference
node_mcp_server -->|"serves responses"| node_assistant

click node_mcp_server "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/main.go"
click node_tool_registration "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/registration.go"
click node_account_tools "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/accounts.go"
click node_app_inventory "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/apps.go"
click node_app_operations "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/app.go"
click node_app_search "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/search.go"
click node_tool_types "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/tools.go"
click node_spin_backend "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/spin/backend.go"
click node_spin_commands "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/spin/spin.go"
click node_resource_registration "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go"
click node_local_context "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go"
click node_command_reference "https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mcp_server,node_tool_registration toneBlue
class node_account_tools,node_app_inventory,node_app_operations,node_app_search,node_tool_types toneAmber
class node_spin_backend,node_spin_commands toneMint
class node_resource_registration,node_local_context,node_command_reference toneRose
class node_assistant,node_spin_cli toneIndigo
```

## Components

### MCP entry

- [MCP server](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/main.go): `main.go`
- [Tool registration](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/registration.go): `internal/tools/registration.go`

### Tool capabilities

- [Account tools](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/accounts.go): `internal/tools/accounts.go`
- [App inventory](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/apps.go): `internal/tools/apps.go`
- [App operations](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/app.go): `internal/tools/app.go`
- [App search](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/search.go): `internal/tools/search.go`
- [Tool responses](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/tools/tools.go): `internal/tools/tools.go`

### Spin backend

- [Backend interface](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/spin/backend.go): `internal/spin/backend.go`
- [Spin CLI adapter](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/spin/spin.go): `internal/spin/spin.go`

### MCP resources

- [Resource registration](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go): `internal/resources/resources.go`
- [Local app context](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go): `internal/resources/resources.go`
- [Command reference](https://github.com/akamai-developers/akamai-functions-mcp-server/blob/main/internal/resources/resources.go): `internal/resources/resources.go`

### Other components

- **AI assistant**
- **Spin aka CLI**

## Connections

- AI assistant → MCP server: sends MCP requests (evidence: `main.go`)
- MCP server → Tool registration: registers tools (evidence: `main.go`)
- MCP server → Resource registration: registers resources (evidence: `main.go`)
- Tool registration → Account tools: dispatches account calls (evidence: `internal/tools/registration.go`)
- Tool registration → App inventory: dispatches inventory calls (evidence: `internal/tools/registration.go`)
- Tool registration → App operations: dispatches app calls (evidence: `internal/tools/registration.go`)
- Tool registration → App search: dispatches search calls (evidence: `internal/tools/registration.go`)
- Account tools → Backend interface: calls account methods (evidence: `internal/tools/accounts.go`)
- App inventory → Backend interface: calls app listing (evidence: `internal/tools/apps.go`)
- App operations → Backend interface: calls app methods (evidence: `internal/tools/app.go`)
- App search → Backend interface: lists accounts and apps (evidence: `internal/tools/search.go`)
- Backend interface → Spin CLI adapter: implemented by (evidence: `internal/spin/spin.go`)
- Spin CLI adapter → Spin aka CLI: executes commands (evidence: `internal/spin/spin.go`)
- Resource registration → Local app context: serves context (evidence: `internal/resources/resources.go`)
- Resource registration → Command reference: serves reference (evidence: `internal/resources/resources.go`)
- MCP server → AI assistant: serves responses (evidence: `main.go`)
