From 9578d700ac92d867255b5e852fe9da812a45b690 Mon Sep 17 00:00:00 2001 From: "gabriel.alves" Date: Wed, 17 Dec 2025 16:06:03 -0300 Subject: [PATCH 1/3] EDU-6837 Documentar mcp.azion.com --- .../pages/devtools/mcp/mcp-cache-testing.mdx | 447 ++++++++++++++++++ .../pages/devtools/mcp/mcp-configuration.mdx | 66 ++- .../en/pages/devtools/mcp/mcp-examples.mdx | 4 +- .../devtools/mcp/mcp-local-development.mdx | 224 +++++++++ .../en/pages/devtools/mcp/mcp-overview.mdx | 22 + .../devtools/mcp/mcp-troubleshooting.mdx | 81 +++- .../pages/devtools/mcp/mcp-configuracao.mdx | 60 ++- .../mcp/mcp-desenvolvimento-local.mdx | 202 ++++++++ .../pt-br/pages/devtools/mcp/mcp-exemplos.mdx | 2 + .../pt-br/pages/devtools/mcp/mcp-overview.mdx | 22 + .../devtools/mcp/mcp-solucao-de-problemas.mdx | 83 +++- .../pages/devtools/mcp/mcp-teste-cache.mdx | 413 ++++++++++++++++ 12 files changed, 1593 insertions(+), 33 deletions(-) create mode 100644 src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx create mode 100644 src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx create mode 100644 src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx create mode 100644 src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx new file mode 100644 index 0000000000..efeae54bfe --- /dev/null +++ b/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx @@ -0,0 +1,447 @@ +--- +title: MCP Cache Testing Guide +description: >- + Comprehensive guide for testing, debugging, and optimizing cache behavior + on Azion Platform using MCP tools and cURL commands. +meta_tags: 'mcp, cache, testing, debugging, optimization, performance' +namespace: documentation_devtools_mcp_cache_testing +menu_namespace: devtoolsMenu +permalink: /documentation/devtools/mcp/cache-testing/ +--- + +import Code from '~/components/Code/Code.astro' + +This guide provides methods for testing, debugging, and optimizing cache behavior on the Azion Edge Platform using MCP tools and direct cURL commands. + +--- + +## Cache debug headers + +Enable cache debug headers by including `Pragma: azion-debug-cache` in your requests. This returns detailed cache information. + +### Debug headers reference + +| Header | Description | Example Values | +|--------|-------------|----------------| +| `X-Cache` | Cache status of the request | `HIT`, `MISS`, `EXPIRED`, `UPDATING`, `STALE` | +| `X-Cache-Key` | The cache key used to store/retrieve the object | `/index.html@@cookie_name=value` | +| `X-Cache-File` | MD5 hash of the cache key | `a1b2c3d4e5f6789...` | +| `X-Cache-Since` | Unix timestamp when object was cached | `1640995200` | +| `X-Cache-Expire` | Unix timestamp when cache expires | `1640995800` | +| `X-Cache-Expire-In` | Seconds remaining until cache expires | `600` | +| `X-Cache-Valid` | Configured TTL in seconds | `3600` | +| `X-Cache-Config` | Azion configuration ID | `1595368520` | +| `X-Cache-ID` | Unique identifier for this request | `#AECFE66100000000C947B9B3...` | + +--- + +## Basic cache testing with cURL + +### Test Azion edge domain + +Always start by testing the `.map.azionedge.net` domain directly: + + + +### Test static assets + + + +### Test production domain via Azion edge + + + +--- + +## Cache key testing + +### Query parameter variations + + + +### Cookie-based variations + +/dev/null | grep "X-Cache-Key" +`} /> + +--- + +## Cache performance testing + +### Consistent edge location testing + +Fix the IP to ensure both requests go to the same edge server: + + + +:::note + The TTFB should be significantly lower on the second request when content is served from cache. +::: + +### Provider comparison + + + +--- + +## Network information + +Get network information including your IP, resolver, and edge location: + + + +This provides: +- Your public IP (useful for searching in Azion logs) +- DNS resolver being used +- Azion edge location serving the request +- Network health status + +--- + +## Real-Time Events monitoring + +### Using Azion CLI + + + +### Key log variables for cache analysis + +| Variable | Description | Example | +|----------|-------------|---------| +| `Cache Key` | Cache key used | `/index.html@@cookie_name=value` | +| `Cache TTL` | Cache duration in seconds | `31536000` | +| `Upstream Cache Status` | Cache status | `HIT`, `MISS`, `BYPASS`, `EXPIRED`, `STALE` | +| `Upstream Response Time` | Origin response time | `-` for cached content | +| `Bytes Sent` | Total bytes delivered | `1024` | +| `Request Time` | Total processing time | `0.001` | + +--- + +## GraphQL queries for cache analysis + +Use MCP's `create_graphql_query` tool or run directly: + + + +### Key performance indicators + +- **Cache Hit Ratio**: Should be >80% for static content +- **Edge Offload**: Percentage of requests served from cache vs origin +- **Origin Response Time**: Compare cached vs non-cached requests +- **Bandwidth Savings**: Bytes served from cache vs origin + +--- + +## Cache configuration via CLI + +### Create cache settings + + + +### Apply via Rules Engine + + + +--- + +## Cache optimization strategies + +### Query string strategy + +| Strategy | Use case | Configuration | +|----------|----------|---------------| +| **Ignore all** | Static assets | `--cache-by-query-string "ignore"` | +| **Whitelist** | APIs with functional params | `--cache-by-query-string "whitelist"` with specific params | +| **Blacklist** | Ignore tracking params | `--cache-by-query-string "blacklist"` with utm_*, fbclid, gclid | + +### Cookie strategy + +| Strategy | Use case | Configuration | +|----------|----------|---------------| +| **Ignore all** | Static content | `--cache-by-cookies "ignore"` | +| **Whitelist** | Personalized content | `--cache-by-cookies "whitelist"` with language, currency | + +### TTL strategy by content type + +| Content Type | Recommended TTL | Example | +|--------------|-----------------|---------| +| Static assets | 30 days | `2592000` seconds | +| Semi-static | 1 hour | `3600` seconds | +| Dynamic | 5 minutes | `300` seconds | +| Real-time | 30 seconds | `30` seconds | + +--- + +## Automated cache health check script + + HIT pattern" +`} /> + +--- + +## Troubleshooting cache issues + +### Low cache hit ratio (< 60%) + +**Diagnosis:** + + + +**Solutions:** +- Configure `cache-by-query-string` to `ignore` for static content +- Use `whitelist` for cookies instead of caching by all cookies +- Implement bypass rules for authenticated users + +### Stale content not updating + +**Diagnosis:** + + + +**Solutions:** + + + +### Dynamic content being cached + +**Diagnosis:** + + + +**Solutions:** +- Add bypass rule for personalized content paths +- Configure proper `cacheByCookie` settings +- Use shorter TTLs for user-specific content + +--- + +## Best practices + +1. **Use `Pragma: azion-debug-cache`** for immediate cache debugging +2. **Monitor Real-Time Events** for cache behavior analysis +3. **Test cache key variations** with different parameters/cookies +4. **Implement tiered TTL strategy** based on content type +5. **Use stale-while-revalidate** for better availability +6. **Monitor cache hit ratios** and optimize configurations +7. **Purge strategically** using wildcards and cache keys +8. **Test from multiple edge locations** using direct IP connections +9. **Automate cache health checks** with shell scripts +10. **Measure performance differences** between cached and non-cached requests + +--- + +## Next steps + +- [MCP Configuration Guide](/en/documentation/devtools/mcp/configuration/) +- [MCP Examples](/en/documentation/devtools/mcp/examples/) +- [MCP Troubleshooting](/en/documentation/devtools/mcp/troubleshooting/) diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-configuration.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-configuration.mdx index aeaab23e47..c96a043515 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-configuration.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-configuration.mdx @@ -169,6 +169,68 @@ Create `.vscode/mcp.json` in your project root: --- +## Warp Terminal + +Configure MCP in Warp's settings. + +### Configuration + +Add to Warp MCP settings: + + + +--- + +## Kiro Code + +Kiro Code supports MCP through its settings file. + +### Setup + +Create `.kiro/settings/mcp.json`: + + + +--- + +## OpenCode + +OpenCode uses TOML configuration for MCP servers. + +### Setup + +Create `.codex/config.toml`: + + + +--- + ## Testing your connection ### Using MCP Inspector @@ -231,4 +293,6 @@ This endpoint provides access to all MCP tools and resources for interacting wit ## Next steps - [Explore MCP examples](/en/documentation/devtools/mcp/examples/) -- [Troubleshooting guide](/en/documentation/devtools/mcp/troubleshooting/) \ No newline at end of file +- [Troubleshooting guide](/en/documentation/devtools/mcp/troubleshooting/) +- [Local Development](/en/documentation/devtools/mcp/local-development/) +- [Cache Testing Guide](/en/documentation/devtools/mcp/cache-testing/) \ No newline at end of file diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx index f8c42df5bd..137f8bbdeb 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx @@ -321,4 +321,6 @@ The assistant provides: ## Next steps - [Configure MCP](/en/documentation/devtools/mcp/configuration/) -- [Troubleshooting guide](/en/documentation/devtools/mcp/troubleshooting/) \ No newline at end of file +- [Troubleshooting guide](/en/documentation/devtools/mcp/troubleshooting/) +- [Local Development](/en/documentation/devtools/mcp/local-development/) +- [Cache Testing Guide](/en/documentation/devtools/mcp/cache-testing/) \ No newline at end of file diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx new file mode 100644 index 0000000000..4fdfcdb72d --- /dev/null +++ b/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx @@ -0,0 +1,224 @@ +--- +title: MCP Local Development +description: >- + Set up a local development environment for Azion MCP server, including + cloning, building, and deploying your own instance. +meta_tags: 'mcp, local development, setup, deployment, contributing' +namespace: documentation_devtools_mcp_local_development +menu_namespace: devtoolsMenu +permalink: /documentation/devtools/mcp/local-development/ +--- + +import Code from '~/components/Code/Code.astro' + +This guide covers how to set up a local development environment for the Azion MCP server, useful for testing, customization, or contributing to the project. + +--- + +## Prerequisites + +Before starting, ensure you have: + +- **Node.js 20+** installed +- **Yarn** package manager +- **Azion CLI** installed: [how to download](https://www.azion.com/en/documentation/products/azion-cli/overview/) +- **Git** for cloning the repository +- **OpenAI API Key** (required for AI features in local development) + +--- + +## Setup + +### 1. Clone the repository + + + +### 2. Install dependencies + + + +### 3. Configure environment variables + + + +### 4. Build the server + + + +--- + +## Running locally + +Start the development server: + + + +### Connect your code assistant + +Once the server is running, configure your code assistant to use the local endpoint: + + + +--- + +## Personal deployment + +Deploy your own instance of the MCP server to Azion Platform. + +### 1. Create personal configuration + + + +### 2. Deploy + + + +### 3. Configure environment variables + +After deployment, add the required environment variables in Azion Console: + +1. Navigate to your application in [Azion Console](https://console.azion.com) +2. Go to **Environment Variables** +3. Add `OPENAI_API_KEY` with your OpenAI API key + +### 4. Use your personal URL + +Update your MCP configuration to use your personal deployment URL instead of the production endpoint. + +--- + +## Testing + +### Using MCP Inspector + +Test your local or personal deployment with MCP Inspector: + + + +In the Inspector interface: + +1. Select **streamable-http** as transport type +2. Enter your URL: `http://localhost:3333` (local) or your personal deployment URL +3. Add authentication header: `Authorization: Bearer YOUR_PERSONAL_TOKEN` +4. Click **Connect** and test available tools + +### Test with Node.js directly + + + +--- + +## Project structure + +The MCP server project is organized as follows: + +| Directory/File | Description | +|----------------|-------------| +| `src/index.ts` | Main entry point | +| `src/core/` | Core functionality | +| `src/core/tools.ts` | Tool definitions | +| `src/core/resources.ts` | Resource definitions | +| `src/core/prompts.ts` | Prompt definitions | +| `src/middlewares/auth.ts` | Authentication middleware | +| `src/helpers/utils.ts` | Helper functions | +| `azion/production` | Production environment configuration | +| `azion/stage` | Stage environment configuration | + +--- + +## Configuration directories + +The project includes predefined configuration directories: + +- **`azion/production`**: Production environment configuration +- **`azion/stage`**: Stage environment configuration +- **`azion/personal`**: Your personal configuration (create this) + +:::note + Never modify the `production` or `stage` directories. Always use a personal configuration for development. +::: + +--- + +## Authentication methods + +The MCP server supports multiple authentication methods: + +| Method | Description | Format | +|--------|-------------|--------| +| **Fast Pass Token** | Internal token for Azion Copilot | Set via `MCP_COPILOT_SERVER_TOKEN` env var | +| **Personal Tokens** | Azion Personal Tokens | Format: `azion[a-zA-Z0-9]{35}` (40 chars) | +| **OAuth Tokens** | Bearer tokens from SSO OAuth flow | Validated against `/oauth/userinfo` | +| **JWT Tokens** | Bearer tokens for v4 API | Validated against `/v4/account/auth/token` | + +Token detection order: JWT first for Bearer tokens, then OAuth if JWT fails. + +--- + +## Troubleshooting local development + +### Server won't start + +1. Verify Node.js version: `node --version` (must be 20+) +2. Check if port 3333 is available +3. Ensure all dependencies are installed: `yarn install` + +### Authentication errors + +1. Verify your Personal Token is valid +2. Check the `OPENAI_API_KEY` is set correctly +3. Ensure the authorization header format is correct + +### Build failures + + + +--- + +## Next steps + +- [MCP Configuration Guide](/en/documentation/devtools/mcp/configuration/) +- [MCP Examples](/en/documentation/devtools/mcp/examples/) +- [MCP Troubleshooting](/en/documentation/devtools/mcp/troubleshooting/) diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx index 67bd023534..21782e1fde 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx @@ -30,6 +30,17 @@ The Azion MCP server is available at: **Production URL**: `https://mcp.azion.com` +### Available environments + +Choose the appropriate environment based on your needs: + +| Environment | URL | Use case | +|-------------|-----|----------| +| **Production** | `https://mcp.azion.com` | Production console, main branch | +| **Stage** | `https://stage-mcp.azion.com` | Stage console, dev branch | +| **Local Development** | `http://localhost:3333` | Running `azion dev` locally | +| **Personal Deploy** | Your personal Azion URL | After deploying with `azion deploy --config-dir azion/personal` | + --- ## Capabilities @@ -48,6 +59,15 @@ The Azion MCP server provides nine specialized tools: | `create_graphql_query` | Build GraphQL queries for analytics | | `deploy_azion_static_site` | Get guides for deploying static sites | +### MCP Resources + +For clients supporting the MCP Resources Protocol, the following resources are available: + +| Resource URI | Description | +|--------------|-------------| +| `azion://static-site/deploy/*` | Step-by-step deployment guides | +| `azion://static-site/test-cache/*` | Cache testing workflows | + --- ## Requirements @@ -63,4 +83,6 @@ The Azion MCP server provides nine specialized tools: - [MCP Configuration Guide](/en/documentation/devtools/mcp/configuration/) - [MCP Examples](/en/documentation/devtools/mcp/examples/) - [MCP Troubleshooting](/en/documentation/devtools/mcp/troubleshooting/) +- [MCP Local Development](/en/documentation/devtools/mcp/local-development/) +- [MCP Cache Testing](/en/documentation/devtools/mcp/cache-testing/) - [Model Context Protocol Specification](https://modelcontextprotocol.io) \ No newline at end of file diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx index 7de2868e5b..0c833ac59d 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx @@ -290,20 +290,75 @@ This guide helps resolve common issues with MCP configuration and usage. --- -## Getting help +## OAuth and SSO issues -If issues persist after trying these solutions: +### Token validation fails -1. **Contact support**: - - Include error messages - - Specify code assistant and version - - Provide configuration (without tokens) - - Describe steps to reproduce +**Symptoms:** +- "Invalid token" after OAuth flow +- UserInfo returns 401 -2. **Community resources**: - - [Azion Discord](https://discord.gg/azion) - - [Azion Forum](https://forum.azion.com) +**Solutions:** -:::note - When reporting issues, never include your Personal Token in logs or screenshots. -::: +1. **Verify token format**: + - Ensure the token is sent with `Bearer` prefix + - Check if using correct SSO domain (production vs stage) + +2. **Check token expiration**: + - OAuth tokens expire after a set period + - Request a new token if expired + +3. **Verify SSO endpoints**: + - Production: `https://sso.azion.com/oauth/*` + - Stage: `https://stage-sso.azion.com/oauth/*` + +### Client not authorized + +**Solutions:** + +1. Verify client ID and secret are correct +2. Check redirect URI matches exactly what's configured in SSO +3. Ensure required scopes are enabled for the client + +--- + +## Environment-specific issues + +### Stage environment not responding + +**Solutions:** + +1. **Verify URL**: + - Stage URL: `https://stage-mcp.azion.com` + - Production URL: `https://mcp.azion.com` + +2. **Check environment status**: + - Stage may have different availability than production + - Use production for critical workflows + +### Local development issues + +**Solutions:** + +1. **Verify server is running**: + + + +2. **Check environment variables**: + + + +3. **Restart local server**: + + + +--- + +## Next steps + + - [MCP Local Development](/en/documentation/devtools/mcp/local-development/) + - [MCP Cache Testing](/en/documentation/devtools/mcp/cache-testing/) + diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx index c0b104fe4c..ab602606ee 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx @@ -159,6 +159,62 @@ O suporte MCP no VS Code pode requerer extensões adicionais. Verifique o market --- +## Warp Terminal + +Configure o MCP nas configurações do Warp. + +### Configuração + +Adicione às configurações MCP do Warp: + + + +--- + +## Kiro Code + +O Kiro Code suporta MCP através de seu arquivo de configurações. + +### Configuração + +Crie `.kiro/settings/mcp.json`: + + + +--- + +## OpenCode + +O OpenCode usa configuração TOML para servidores MCP. + +### Configuração + +Crie `.codex/config.toml`: + + + +--- + ## Testando sua conexão ### Usando o MCP Inspector @@ -221,4 +277,6 @@ Desenvolvimento local requer executar o servidor MCP localmente. Veja o [reposit ## Próximos passos - [Explorar exemplos MCP](/pt-br/documentacao/devtools/mcp/exemplos/) -- [Guia de solução de problemas](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) \ No newline at end of file +- [Guia de solução de problemas](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) +- [Desenvolvimento Local](/pt-br/documentacao/devtools/mcp/desenvolvimento-local/) +- [Guia de Teste de Cache](/pt-br/documentacao/devtools/mcp/teste-cache/) \ No newline at end of file diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx new file mode 100644 index 0000000000..1ba2c59a72 --- /dev/null +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx @@ -0,0 +1,202 @@ +--- +title: Desenvolvimento Local MCP +description: >- + Configure um ambiente de desenvolvimento local para o servidor MCP da Azion, + incluindo clonagem, build e deploy de sua própria instância. +meta_tags: 'mcp, desenvolvimento local, setup, deployment, contribuição' +namespace: documentation_devtools_mcp_local_development +menu_namespace: devtoolsMenu +permalink: /documentacao/devtools/mcp/desenvolvimento-local/ +--- + +import Code from '~/components/Code/Code.astro' + +Este guia cobre como configurar um ambiente de desenvolvimento local para o servidor MCP da Azion, útil para testes, customização ou contribuição ao projeto. + +--- + +## Pré-requisitos + +Antes de começar, certifique-se de ter: + +- **Node.js 20+** instalado +- **Yarn** gerenciador de pacotes +- **Azion CLI** instalado: [como baixar](https://www.azion.com/pt-br/documentacao/produtos/azion-cli/visao-geral/) +- **Git** para clonar o repositório +- **Chave de API OpenAI** (necessária para recursos de IA no desenvolvimento local) + +--- + +## Configuração + +### 1. Clonar o repositório + + + +### 2. Instalar dependências + + + +### 3. Configurar variáveis de ambiente + + + +### 4. Build do servidor + + + +--- + +## Executando localmente + +Inicie o servidor de desenvolvimento: + + + +### Conectar seu assistente de código + +Uma vez que o servidor esteja rodando, configure seu assistente de código para usar o endpoint local: + + + +--- + +## Deploy pessoal + +Faça deploy de sua própria instância do servidor MCP na Plataforma Azion. + +### 1. Criar configuração pessoal + + + +### 2. Deploy + + + +### 3. Configurar variáveis de ambiente + +Após o deploy, adicione as variáveis de ambiente necessárias no Console Azion: + +1. Navegue até sua aplicação no [Console Azion](https://console.azion.com) +2. Vá para **Variáveis de Ambiente** +3. Adicione `OPENAI_API_KEY` com sua chave de API OpenAI + +### 4. Usar sua URL pessoal + +Atualize sua configuração MCP para usar a URL do seu deploy pessoal em vez do endpoint de produção. + +--- + +## Testes + +### Usando o MCP Inspector + +Teste seu deploy local ou pessoal com o MCP Inspector: + + + +Na interface do Inspector: + +1. Selecione **streamable-http** como tipo de transporte +2. Digite sua URL: `http://localhost:3333` (local) ou sua URL de deploy pessoal +3. Adicione o header de autenticação: `Authorization: Bearer SEU_PERSONAL_TOKEN` +4. Clique em **Connect** e teste as ferramentas disponíveis + +### Testar diretamente com Node.js + + + +--- + +## Estrutura do projeto + +O projeto do servidor MCP está organizado da seguinte forma: + +| Diretório/Arquivo | Descrição | +|-------------------|-----------| +| `src/index.ts` | Ponto de entrada principal | +| `src/core/` | Funcionalidade central | +| `src/core/tools.ts` | Definições de ferramentas | +| `src/core/resources.ts` | Definições de recursos | +| `src/core/prompts.ts` | Definições de prompts | +| `src/middlewares/auth.ts` | Middleware de autenticação | +| `src/helpers/utils.ts` | Funções auxiliares | +| `azion/production` | Configuração do ambiente de produção | +| `azion/stage` | Configuração do ambiente de stage | + +--- + +## Diretórios de configuração + +O projeto inclui diretórios de configuração predefinidos: + +- **`azion/production`**: Configuração do ambiente de produção +- **`azion/stage`**: Configuração do ambiente de stage +- **`azion/personal`**: Sua configuração pessoal (crie este) + +:::note +Nunca modifique os diretórios `production` ou `stage`. Sempre use uma configuração pessoal para desenvolvimento. +::: + +--- + +## Métodos de autenticação + +O servidor MCP suporta múltiplos métodos de autenticação: + +| Método | Descrição | Formato | +|--------|-----------|---------| +| **Fast Pass Token** | Token interno para Azion Copilot | Definido via variável de ambiente `MCP_COPILOT_SERVER_TOKEN` | +| **Personal Tokens** | Personal Tokens Azion | Formato: `azion[a-zA-Z0-9]{35}` (40 caracteres) | +| **OAuth Tokens** | Bearer tokens do fluxo OAuth SSO | Validado contra `/oauth/userinfo` | +| **JWT Tokens** | Bearer tokens para autenticação API v4 | Validado contra `/v4/account/auth/token` | + +Ordem de detecção de token: JWT primeiro para Bearer tokens, depois OAuth se JWT falhar. + +--- + +## Solução de problemas no desenvolvimento local + +### Servidor não inicia + +1. Verifique a versão do Node.js: `node --version` (deve ser 20+) +2. Verifique se a porta 3333 está disponível +3. Certifique-se de que todas as dependências estão instaladas: `yarn install` + +### Erros de autenticação + +1. Verifique se seu Personal Token é válido +2. Verifique se `OPENAI_API_KEY` está definido corretamente +3. Certifique-se de que o formato do header de autorização está correto + +### Falhas no build + + + +--- + +## Próximos passos + +- [Guia de Configuração MCP](/pt-br/documentacao/devtools/mcp/configuracao/) +- [Exemplos MCP](/pt-br/documentacao/devtools/mcp/exemplos/) +- [Solução de Problemas MCP](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx index 7c6279c77a..e3198cb941 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx @@ -316,3 +316,5 @@ O assistente fornece: - [Configurar MCP](/pt-br/documentacao/devtools/mcp/configuracao/) - [Guia de solução de problemas](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) +- [Desenvolvimento Local](/pt-br/documentacao/devtools/mcp/desenvolvimento-local/) +- [Guia de Teste de Cache](/pt-br/documentacao/devtools/mcp/teste-cache/) diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx index adc5c8c543..65a81844d5 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx @@ -30,6 +30,17 @@ O servidor MCP da Azion está disponível em: **URL de Produção**: `https://mcp.azion.com` +### Ambientes disponíveis + +Escolha o ambiente apropriado baseado em suas necessidades: + +| Ambiente | URL | Caso de uso | +|----------|-----|-------------| +| **Produção** | `https://mcp.azion.com` | Console de produção, branch main | +| **Stage** | `https://stage-mcp.azion.com` | Console de stage, branch dev | +| **Desenvolvimento Local** | `http://localhost:3333` | Executando `azion dev` localmente | +| **Deploy Pessoal** | Sua URL pessoal Azion | Após deploy com `azion deploy --config-dir azion/personal` | + --- ## Capacidades @@ -48,6 +59,15 @@ O servidor MCP da Azion fornece nove ferramentas especializadas: | `create_graphql_query` | Construir queries GraphQL para analytics | | `deploy_azion_static_site` | Obter guias para deploy de sites estáticos | +### MCP Resources + +Para clientes que suportam o MCP Resources Protocol, os seguintes recursos estão disponíveis: + +| URI do Recurso | Descrição | +|----------------|-----------| +| `azion://static-site/deploy/*` | Guias de deploy passo a passo | +| `azion://static-site/test-cache/*` | Fluxos de trabalho para teste de cache | + --- ## Requisitos @@ -63,4 +83,6 @@ O servidor MCP da Azion fornece nove ferramentas especializadas: - [Guia de Configuração MCP](/pt-br/documentacao/devtools/mcp/configuracao/) - [Exemplos MCP](/pt-br/documentacao/devtools/mcp/exemplos/) - [Solução de Problemas MCP](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) +- [Desenvolvimento Local MCP](/pt-br/documentacao/devtools/mcp/desenvolvimento-local/) +- [Teste de Cache MCP](/pt-br/documentacao/devtools/mcp/teste-cache/) - [Especificação Model Context Protocol](https://modelcontextprotocol.io) \ No newline at end of file diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx index f4a6557d3e..068c33d781 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx @@ -286,25 +286,74 @@ Nunca compartilhe seu Personal Token ou faça commit dele no controle de versão --- -## Obtendo ajuda +## Problemas de OAuth e SSO -Se os problemas persistirem após tentar estas soluções: +### Falha na validação do token -1. **Verificar GitHub Issues**: - - [Repositório Azion Copilot API](https://github.com/aziontech/azion-copilot-api/issues) - - Buscar issues existentes - - Criar nova issue com detalhes +**Sintomas:** +- "Invalid token" após fluxo OAuth +- UserInfo retorna 401 + +**Soluções:** + +1. **Verificar formato do token**: + - Certifique-se de que o token é enviado com prefixo `Bearer` + - Verifique se está usando o domínio SSO correto (produção vs stage) + +2. **Verificar expiração do token**: + - Tokens OAuth expiram após um período definido + - Solicite um novo token se expirado + +3. **Verificar endpoints SSO**: + - Produção: `https://sso.azion.com/oauth/*` + - Stage: `https://stage-sso.azion.com/oauth/*` + +### Cliente não autorizado + +**Soluções:** + +1. Verifique se client ID e secret estão corretos +2. Verifique se a URI de redirect corresponde exatamente ao configurado no SSO +3. Certifique-se de que os scopes necessários estão habilitados para o cliente + +--- + +## Problemas específicos de ambiente + +### Ambiente stage não responde -2. **Contatar suporte**: - - Inclua mensagens de erro - - Especifique assistente de código e versão - - Forneça configuração (sem tokens) - - Descreva passos para reproduzir +**Soluções:** + +1. **Verificar URL**: + - URL Stage: `https://stage-mcp.azion.com` + - URL Produção: `https://mcp.azion.com` + +2. **Verificar status do ambiente**: + - Stage pode ter disponibilidade diferente de produção + - Use produção para fluxos críticos + +### Problemas de desenvolvimento local + +**Soluções:** + +1. **Verificar se o servidor está rodando**: + + + +2. **Verificar variáveis de ambiente**: + + + +3. **Reiniciar servidor local**: + + + +--- -3. **Recursos da comunidade**: - - [Discord Azion](https://discord.gg/azion) - - [Fórum Azion](https://forum.azion.com) +## Próximos passos -:::note -Ao reportar problemas, nunca inclua seu Personal Token em logs ou screenshots. -::: \ No newline at end of file + - [Desenvolvimento Local MCP](/pt-br/documentacao/devtools/mcp/desenvolvimento-local/) + - [Teste de Cache MCP](/pt-br/documentacao/devtools/mcp/teste-cache/) diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx new file mode 100644 index 0000000000..6b1b61c131 --- /dev/null +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx @@ -0,0 +1,413 @@ +--- +title: Guia de Teste de Cache MCP +description: >- + Guia completo para testar, debugar e otimizar o comportamento de cache + na Plataforma Azion usando ferramentas MCP e comandos cURL. +meta_tags: 'mcp, cache, teste, debug, otimização, performance' +namespace: documentation_devtools_mcp_cache_testing +menu_namespace: devtoolsMenu +permalink: /documentacao/devtools/mcp/teste-cache/ +--- + +import Code from '~/components/Code/Code.astro' + +Este guia fornece métodos para testar, debugar e otimizar o comportamento de cache na Plataforma Edge da Azion usando ferramentas MCP e comandos cURL diretos. + +--- + +## Headers de debug de cache + +Habilite os headers de debug de cache incluindo `Pragma: azion-debug-cache` em suas requisições. Isso retorna informações detalhadas sobre o cache. + +### Referência de headers de debug + +| Header | Descrição | Valores de Exemplo | +|--------|-----------|-------------------| +| `X-Cache` | Status do cache da requisição | `HIT`, `MISS`, `EXPIRED`, `UPDATING`, `STALE` | +| `X-Cache-Key` | A chave de cache usada para armazenar/recuperar o objeto | `/index.html@@cookie_name=value` | +| `X-Cache-File` | Hash MD5 da chave de cache | `a1b2c3d4e5f6789...` | +| `X-Cache-Since` | Timestamp Unix de quando o objeto foi cacheado | `1640995200` | +| `X-Cache-Expire` | Timestamp Unix de quando o cache expira | `1640995800` | +| `X-Cache-Expire-In` | Segundos restantes até o cache expirar | `600` | +| `X-Cache-Valid` | TTL configurado em segundos | `3600` | +| `X-Cache-Config` | ID de configuração Azion | `1595368520` | +| `X-Cache-ID` | Identificador único para esta requisição | `#AECFE66100000000C947B9B3...` | + +--- + +## Teste básico de cache com cURL + +### Testar domínio edge da Azion + +Sempre comece testando o domínio `.map.azionedge.net` diretamente: + + + +### Testar assets estáticos + + + +### Testar domínio de produção via edge Azion + + + +--- + +## Teste de chave de cache + +### Variações de parâmetros de query + + + +### Variações baseadas em cookies + +/dev/null | grep "X-Cache-Key"`} /> + +--- + +## Teste de performance de cache + +### Teste consistente de localização edge + +Fixe o IP para garantir que ambas as requisições vão para o mesmo servidor edge: + + + +:::note +O TTFB deve ser significativamente menor na segunda requisição quando o conteúdo é servido do cache. +::: + +### Comparação de provedores + + + +--- + +## Informações de rede + +Obtenha informações de rede incluindo seu IP, resolver e localização edge: + + + +Isso fornece: +- Seu IP público (útil para buscar nos logs Azion) +- Resolver DNS sendo usado +- Localização edge Azion servindo a requisição +- Status de saúde da rede + +--- + +## Monitoramento de Real-Time Events + +### Usando Azion CLI + + + +### Variáveis de log chave para análise de cache + +| Variável | Descrição | Exemplo | +|----------|-----------|---------| +| `Cache Key` | Chave de cache usada | `/index.html@@cookie_name=value` | +| `Cache TTL` | Duração do cache em segundos | `31536000` | +| `Upstream Cache Status` | Status do cache | `HIT`, `MISS`, `BYPASS`, `EXPIRED`, `STALE` | +| `Upstream Response Time` | Tempo de resposta da origem | `-` para conteúdo cacheado | +| `Bytes Sent` | Total de bytes entregues | `1024` | +| `Request Time` | Tempo total de processamento | `0.001` | + +--- + +## Queries GraphQL para análise de cache + +Use a ferramenta `create_graphql_query` do MCP ou execute diretamente: + + + +### Indicadores chave de performance + +- **Taxa de Cache Hit**: Deve ser >80% para conteúdo estático +- **Edge Offload**: Porcentagem de requisições servidas do cache vs origem +- **Tempo de Resposta da Origem**: Compare requisições cacheadas vs não-cacheadas +- **Economia de Bandwidth**: Bytes servidos do cache vs origem + +--- + +## Configuração de cache via CLI + +### Criar configurações de cache + + + +### Aplicar via Rules Engine + + + +--- + +## Estratégias de otimização de cache + +### Estratégia de query string + +| Estratégia | Caso de uso | Configuração | +|------------|-------------|--------------| +| **Ignorar todas** | Assets estáticos | `--cache-by-query-string "ignore"` | +| **Whitelist** | APIs com params funcionais | `--cache-by-query-string "whitelist"` com params específicos | +| **Blacklist** | Ignorar params de tracking | `--cache-by-query-string "blacklist"` com utm_*, fbclid, gclid | + +### Estratégia de cookies + +| Estratégia | Caso de uso | Configuração | +|------------|-------------|--------------| +| **Ignorar todos** | Conteúdo estático | `--cache-by-cookies "ignore"` | +| **Whitelist** | Conteúdo personalizado | `--cache-by-cookies "whitelist"` com language, currency | + +### Estratégia de TTL por tipo de conteúdo + +| Tipo de Conteúdo | TTL Recomendado | Exemplo | +|------------------|-----------------|---------| +| Assets estáticos | 30 dias | `2592000` segundos | +| Semi-estático | 1 hora | `3600` segundos | +| Dinâmico | 5 minutos | `300` segundos | +| Tempo real | 30 segundos | `30` segundos | + +--- + +## Script automatizado de verificação de cache + + HIT"`} /> + +--- + +## Solução de problemas de cache + +### Baixa taxa de cache hit (< 60%) + +**Diagnóstico:** + + + +**Soluções:** +- Configure `cache-by-query-string` para `ignore` para conteúdo estático +- Use `whitelist` para cookies em vez de cachear por todos os cookies +- Implemente regras de bypass para usuários autenticados + +### Conteúdo stale não atualizando + +**Diagnóstico:** + + + +**Soluções:** + + + +### Conteúdo dinâmico sendo cacheado + +**Diagnóstico:** + + + +**Soluções:** +- Adicione regra de bypass para caminhos de conteúdo personalizado +- Configure as configurações de `cacheByCookie` adequadamente +- Use TTLs mais curtos para conteúdo específico do usuário + +--- + +## Boas práticas + +1. **Use `Pragma: azion-debug-cache`** para debug imediato de cache +2. **Monitore Real-Time Events** para análise de comportamento de cache +3. **Teste variações de chave de cache** com diferentes parâmetros/cookies +4. **Implemente estratégia de TTL em camadas** baseada no tipo de conteúdo +5. **Use stale-while-revalidate** para melhor disponibilidade +6. **Monitore taxas de cache hit** e otimize configurações +7. **Purgue estrategicamente** usando wildcards e chaves de cache +8. **Teste de múltiplas localizações edge** usando conexões IP diretas +9. **Automatize verificações de saúde do cache** com scripts shell +10. **Meça diferenças de performance** entre requisições cacheadas e não-cacheadas + +--- + +## Próximos passos + +- [Guia de Configuração MCP](/pt-br/documentacao/devtools/mcp/configuracao/) +- [Exemplos MCP](/pt-br/documentacao/devtools/mcp/exemplos/) +- [Solução de Problemas MCP](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) From f3000218278d289c87d3d58e6cf81a9643358796 Mon Sep 17 00:00:00 2001 From: "gabriel.alves" Date: Tue, 20 Jan 2026 11:53:57 -0300 Subject: [PATCH 2/3] Updating docs regardiing MCP --- .../pages/devtools/mcp/mcp-troubleshooting.mdx | 17 +++++++++++++++++ .../devtools/mcp/mcp-solucao-de-problemas.mdx | 18 ++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx index 0c833ac59d..a2c034d586 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx @@ -355,6 +355,23 @@ echo $OPENAI_API_KEY`} /> + +## Getting help + +If issues persist after trying these solutions: + +1. **Contact support**: + - Include error messages + - Specify code assistant and version + - Provide configuration (without tokens) + - Describe steps to reproduce + +2. **Community resources**: + - [Azion Discord](https://discord.gg/azion) + +:::note + When reporting issues, never include your Personal Token in logs or screenshots. +::: --- ## Next steps diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx index 068c33d781..490b458ffa 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx @@ -351,6 +351,24 @@ echo $OPENAI_API_KEY`} /> + +## Obtendo ajuda + +Se os problemas persistirem após tentar essas soluções: + +1. **Entre em contato com o suporte**: + - Inclua mensagens de erro + - Especifique o assistente de código e versão + - Forneça a configuração (sem tokens) + - Descreva os passos para reproduzir + +2. **Recursos da comunidade**: + - [Discord da Azion](https://discord.gg/azion) + +:::note + Ao reportar problemas, nunca inclua seu Personal Token em logs ou capturas de tela. +::: + --- ## Próximos passos From d19b2731e142bf90fa6351693e9d76f07fc3d33b Mon Sep 17 00:00:00 2001 From: "gabriel.alves" Date: Tue, 31 Mar 2026 15:32:21 -0300 Subject: [PATCH 3/3] EDU-6837 update MCP Docs --- src/content/docs/en/homes/dev-tools.mdx | 6 + .../pages/devtools/mcp/mcp-cache-testing.mdx | 25 +- .../pages/devtools/mcp/mcp-configuration.mdx | 2 +- .../en/pages/devtools/mcp/mcp-examples.mdx | 2 +- .../pages/devtools/mcp/mcp-how-it-works.mdx | 340 ++++++++++++++++++ .../devtools/mcp/mcp-local-development.mdx | 2 +- .../en/pages/devtools/mcp/mcp-overview.mdx | 4 +- .../devtools/mcp/mcp-troubleshooting.mdx | 2 +- src/content/docs/pt-br/homes/dev-tools.mdx | 7 + .../pages/devtools/mcp/mcp-como-funciona.mdx | 340 ++++++++++++++++++ .../pages/devtools/mcp/mcp-configuracao.mdx | 2 +- .../mcp/mcp-desenvolvimento-local.mdx | 2 +- .../pt-br/pages/devtools/mcp/mcp-exemplos.mdx | 4 +- .../pt-br/pages/devtools/mcp/mcp-overview.mdx | 3 +- .../devtools/mcp/mcp-solucao-de-problemas.mdx | 2 +- .../pages/devtools/mcp/mcp-teste-cache.mdx | 20 +- .../docs/pt-br/pages/guias/mcp/create-mcp.mdx | 6 +- src/data/availableMenu.ts | 3 +- src/i18n/en/devtoolsMenu.ts | 1 + src/i18n/en/mcpMenu.ts | 23 ++ src/i18n/pt-br/devtoolsMenu.ts | 1 + src/i18n/pt-br/mcpMenu.ts | 23 ++ 22 files changed, 783 insertions(+), 37 deletions(-) create mode 100644 src/content/docs/en/pages/devtools/mcp/mcp-how-it-works.mdx create mode 100644 src/content/docs/pt-br/pages/devtools/mcp/mcp-como-funciona.mdx create mode 100644 src/i18n/en/mcpMenu.ts create mode 100644 src/i18n/pt-br/mcpMenu.ts diff --git a/src/content/docs/en/homes/dev-tools.mdx b/src/content/docs/en/homes/dev-tools.mdx index 1f5b537fb8..6916ca540b 100644 --- a/src/content/docs/en/homes/dev-tools.mdx +++ b/src/content/docs/en/homes/dev-tools.mdx @@ -37,6 +37,12 @@ product_cards: title: GraphQL API description: 'Request the data you want and receive nothing more, nothing less.' link: /en/documentation/devtools/graphql-api/ + - icon: /assets/docs/images/uploads/vector.svg + title: MCP + description: >- + Connect AI code assistants to Azion Platform through the Model Context Protocol, + enabling intelligent assistance for deployment, configuration, and management tasks. + link: /en/documentation/devtools/mcp/ - icon: /assets/docs/images/uploads/vector.svg title: SDK description: >- diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx index efeae54bfe..58c6d22967 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-cache-testing.mdx @@ -5,13 +5,14 @@ description: >- on Azion Platform using MCP tools and cURL commands. meta_tags: 'mcp, cache, testing, debugging, optimization, performance' namespace: documentation_devtools_mcp_cache_testing -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentation/devtools/mcp/cache-testing/ + --- import Code from '~/components/Code/Code.astro' -This guide provides methods for testing, debugging, and optimizing cache behavior on the Azion Edge Platform using MCP tools and direct cURL commands. +This guide provides methods for testing, debugging, and optimizing cache behavior on the Azion Platform using MCP tools and direct cURL commands. --- @@ -37,7 +38,7 @@ Enable cache debug headers by including `Pragma: azion-debug-cache` in your requ ## Basic cache testing with cURL -### Test Azion edge domain +### Test Azion domain Always start by testing the `.map.azionedge.net` domain directly: @@ -64,10 +65,10 @@ curl -H "Pragma: azion-debug-cache" -I "https://yourdomain.com/image.jpg?version curl -H "Pragma: azion-debug-cache" -H "Cookie: session_id=abc123" -I "https://yourdomain.com/" `} /> -### Test production domain via Azion edge +### Test production domain via Azion /dev/null | g ## Cache performance testing -### Consistent edge location testing +### Consistent location testing -Fix the IP to ensure both requests go to the same edge server: +Fix the IP to ensure both requests go to the same server: - integration with various code assistants and development tools. meta_tags: 'mcp, configuration, claude, cursor, windsurf, setup' namespace: documentation_devtools_mcp_configuration -menu_namespace: devtoolsMenu permalink: /documentation/devtools/mcp/configuration/ +menu_namespace: mcpMenu --- import Code from '~/components/Code/Code.astro' diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx index 137f8bbdeb..3f9145ce33 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-examples.mdx @@ -5,7 +5,7 @@ description: >- with AI code assistants to streamline Azion Platform development. meta_tags: 'mcp, examples, workflows, deployment, graphql, rules engine' namespace: documentation_devtools_mcp_examples -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentation/devtools/mcp/examples/ --- diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-how-it-works.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-how-it-works.mdx new file mode 100644 index 0000000000..f7eafea5b1 --- /dev/null +++ b/src/content/docs/en/pages/devtools/mcp/mcp-how-it-works.mdx @@ -0,0 +1,340 @@ +--- +title: How MCP Works +description: >- + Understand the technical architecture behind Azion's Model Context Protocol and learn + how to implement your own MCP server using modern technologies. +meta_tags: 'mcp, architecture, implementation, node.js, typescript, edge functions' +namespace: documentation_devtools_mcp_how_it_works +menu_namespace: mcpMenu +permalink: /documentation/devtools/mcp/how-it-works/ +--- + +import Code from '~/components/Code/Code.astro' + +The Azion MCP server operates as a bridge between AI assistants and the Azion Platform, providing secure access to documentation, tools, and resources through a standardized protocol. + +--- + +## Technical Architecture + +MCP implements a client-server model using Anthropic's Model Context Protocol. The architecture consists of three main components: + +### Technology Stack + +| Component | Technology | Purpose | +|------------|------------|-----------| +| **Runtime** | Node.js 20+ | JavaScript execution environment | +| **Language** | TypeScript | Static typing and safety | +| **Protocol** | MCP SDK | Anthropic protocol implementation | +| **Hosting** | Edge Functions | Distributed execution on Azion | +| **Authentication** | Personal Token / OAuth | Secure access control | + +### Communication Flow + +```text +AI Assistant (Client) + ↓ HTTP/WebSocket Connection +MCP Server (Edge Function) + ↓ API Calls +Azion Platform (Resources) +``` + +The flow works as follows: + +1. **Connection**: The MCP client establishes connection with the server using HTTP or WebSocket +2. **Authentication**: The Personal Token validates the user's identity +3. **Discovery**: The client discovers available tools and resources +4. **Execution**: The assistant invokes tools as needed +5. **Response**: The server returns structured data to the client + +--- + +## MCP Components + +The MCP protocol defines three main types of capabilities that a server can expose: + +### Tools + +Tools are functions that the AI assistant can invoke to perform actions or fetch information. Each tool has: + +- **Name**: Unique identifier (e.g., `search_azion_docs_and_site`) +- **Description**: Explains the purpose and when to use it +- **Input Schema**: Defines expected parameters using JSON Schema +- **Handler**: Function that executes the logic + +Example tool definition: + + { + // Search implementation + const results = await searchDocs(args.query, args.docsAmount); + return { + content: [{ + type: 'text', + text: JSON.stringify(results) + }] + }; + } +);`} /> + +### Resources + +Resources are structured data that can be read by the client, similar to files. They use URIs for identification: + + ({ + contents: [{ + uri: 'azion://static-site/deploy/step-0-preparation', + name: 'step-0-preparation.md', + mimeType: 'text/markdown', + text: guideContent + }] + }) +);`} /> + +Resource URIs follow the format: `azion://[category]/[resource]/[item]` + +### Prompts + +Prompts are pre-configured templates that help with common scenarios: + + { + return { + messages: [{ + role: 'user', + content: { + type: 'text', + text: 'Help me deploy a ' + args.framework + ' site to Azion' + } + }] + }; + } +);`} /> + +--- + +## Implementing an MCP Server + +To implement your own MCP server, follow these steps: + +### Project Structure + + + +### Entry Point + +The main file initializes the server and registers capabilities: + + { + return server.handleRequest(request); + } +};`} /> + +### Authentication + +The MCP server supports multiple authentication methods: + + { + const authHeader = request.headers.get('Authorization'); + + if (!authHeader) { + return { success: false, error: 'Token not provided' }; + } + + const token = authHeader.replace('Bearer ', ''); + + // Verify Personal Token (format: azion + 35 chars) + if (token.startsWith('azion') && token.length === 40) { + return validatePersonalToken(token); + } + + // Verify OAuth token via SSO + return validateOAuthToken(token); +}`} /> + +--- + +## Deploying to Azion + +The MCP server can be deployed as an Edge Function on Azion: + +### Configuration + +Create an `azion.config.ts` file in the project root: + + + +### Deploy + +Use the Azion CLI to deploy: + + + +The deploy creates a publicly accessible URL that can be configured in MCP clients. + +--- + +## Best Practices + +### Tool Design + +1. **Descriptive names**: Use clear verbs and nouns (e.g., `search_docs`, `create_rule`) +2. **Typed parameters**: Define complete JSON Schema schemas +3. **Clear descriptions**: Explain when and how to use each tool +4. **Error handling**: Return informative error messages +5. **Idempotency**: Tools should be safe for multiple calls + +### Performance + +1. **Response caching**: Implement cache for frequently accessed data +2. **Pagination**: Use pagination for large datasets +3. **Timeouts**: Set appropriate timeouts for long operations +4. **Compression**: Compress large responses + +### Security + +1. **Input validation**: Always validate input parameters +2. **Rate limiting**: Implement rate limits per token +3. **Audit logs**: Log all sensitive operations +4. **Sanitization**: Remove sensitive data before returning + +--- + +## Complete Example + +See a complete example of a documentation search tool: + + + +--- + +## Additional Resources + +- [MCP Specification](https://modelcontextprotocol.io) - Official protocol documentation +- [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) - Official TypeScript SDK +- [Azion MCP Repository](https://github.com/aziontech/azion-copilot-api) - Azion server source code +- [MCP Overview](/en/documentation/devtools/mcp/) - Introduction to MCP +- [Configuration Guide](/en/documentation/devtools/mcp/configuration/) - Set up your environment +- [Practical Examples](/en/documentation/devtools/mcp/examples/) - Real-world use cases diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx index 4fdfcdb72d..3b99ac8112 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-local-development.mdx @@ -5,7 +5,7 @@ description: >- cloning, building, and deploying your own instance. meta_tags: 'mcp, local development, setup, deployment, contributing' namespace: documentation_devtools_mcp_local_development -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentation/devtools/mcp/local-development/ --- diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx index 21782e1fde..ef459aa2b9 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-overview.mdx @@ -5,8 +5,9 @@ description: >- enabling intelligent assistance for deployment, configuration, and management tasks. meta_tags: 'mcp, ai, code assistant, claude, cursor, windsurf, integration' namespace: documentation_devtools_mcp -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentation/devtools/mcp/ + --- The **Model Context Protocol (MCP)** is an open standard developed by Anthropic that enables AI assistants to securely connect to data sources and tools. Azion's MCP server allows code assistants like Claude, Cursor, and Windsurf to access Azion Platform capabilities directly, providing intelligent assistance for your development workflow. @@ -80,6 +81,7 @@ For clients supporting the MCP Resources Protocol, the following resources are a ## Related resources +- [How MCP Works](/en/documentation/devtools/mcp/how-it-works/) - [MCP Configuration Guide](/en/documentation/devtools/mcp/configuration/) - [MCP Examples](/en/documentation/devtools/mcp/examples/) - [MCP Troubleshooting](/en/documentation/devtools/mcp/troubleshooting/) diff --git a/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx b/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx index a2c034d586..b96f97a7b3 100644 --- a/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx +++ b/src/content/docs/en/pages/devtools/mcp/mcp-troubleshooting.mdx @@ -5,7 +5,7 @@ description: >- with Azion Platform and code assistants. meta_tags: 'mcp, troubleshooting, errors, debugging, solutions' namespace: documentation_devtools_mcp_troubleshooting -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentation/devtools/mcp/troubleshooting/ --- diff --git a/src/content/docs/pt-br/homes/dev-tools.mdx b/src/content/docs/pt-br/homes/dev-tools.mdx index c0e4a60d6f..a5709acd9e 100644 --- a/src/content/docs/pt-br/homes/dev-tools.mdx +++ b/src/content/docs/pt-br/homes/dev-tools.mdx @@ -36,6 +36,12 @@ product_cards: title: Console Kit description: O Console Kit da Azion é um kit de desenvolvimento front-end para criar uma interface personalizada do Console da Azion. link: /pt-br/documentacao/devtools/console-kit/ + - icon: /assets/docs/images/uploads/vector.svg + title: MCP + description: >- + Conecte assistentes de código com IA à Plataforma Azion através do Model + Context Protocol para assistência inteligente no seu fluxo de desenvolvimento. + link: /pt-br/documentacao/devtools/mcp/ - icon: /assets/docs/images/uploads/vector.svg title: SDK description: Desenvolva aplicações utilizando o Azion SDK para a linguagem Go. @@ -44,5 +50,6 @@ product_cards: title: Terraform description: Gerencie sua estrutura como código com o Azion Terraform Provider. link: /pt-br/documentacao/produtos/terraform-provider/ + --- diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-como-funciona.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-como-funciona.mdx new file mode 100644 index 0000000000..6a69005b61 --- /dev/null +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-como-funciona.mdx @@ -0,0 +1,340 @@ +--- +title: Como o MCP Funciona +description: >- + Entenda a arquitetura técnica por trás do Model Context Protocol da Azion e aprenda + como implementar seu próprio servidor MCP usando tecnologias modernas. +meta_tags: 'mcp, arquitetura, implementação, node.js, typescript, edge functions' +namespace: documentation_devtools_mcp_how_it_works +menu_namespace: mcpMenu +permalink: /documentacao/devtools/mcp/como-funciona/ +--- + +import Code from '~/components/Code/Code.astro' + +O servidor MCP da Azion opera como uma ponte entre assistentes de IA e a Plataforma Azion, fornecendo acesso seguro a documentação, ferramentas e recursos através de um protocolo padronizado. + +--- + +## Arquitetura Técnica + +O MCP implementa um modelo cliente-servidor usando o protocolo Model Context Protocol da Anthropic. A arquitetura consiste em três componentes principais: + +### Stack Tecnológica + +| Componente | Tecnologia | Propósito | +|------------|------------|-----------| +| **Runtime** | Node.js 20+ | Ambiente de execução JavaScript | +| **Linguagem** | TypeScript | Tipagem estática e segurança | +| **Protocolo** | MCP SDK | Implementação do protocolo Anthropic | +| **Hospedagem** | Edge Functions | Execução distribuída na Azion | +| **Autenticação** | Personal Token / OAuth | Controle de acesso seguro | + +### Fluxo de Comunicação + +```text +Assistente de IA (Cliente) + ↓ Conexão HTTP/WebSocket +Servidor MCP (Edge Function) + ↓ Chamadas de API +Plataforma Azion (Recursos) +``` + +O fluxo funciona da seguinte maneira: + +1. **Conexão**: O cliente MCP estabelece conexão com o servidor usando HTTP ou WebSocket +2. **Autenticação**: O Personal Token valida a identidade do usuário +3. **Descoberta**: O cliente descobre ferramentas e recursos disponíveis +4. **Execução**: O assistente invoca ferramentas conforme necessário +5. **Resposta**: O servidor retorna dados estruturados ao cliente + +--- + +## Componentes do MCP + +O protocolo MCP define três tipos principais de capacidades que um servidor pode expor: + +### Tools (Ferramentas) + +Tools são funções que o assistente de IA pode invocar para realizar ações ou buscar informações. Cada tool possui: + +- **Nome**: Identificador único (ex: `search_azion_docs_and_site`) +- **Descrição**: Explica o propósito e quando usar +- **Schema de entrada**: Define parâmetros esperados usando JSON Schema +- **Handler**: Função que executa a lógica + +Exemplo de definição de tool: + + { + // Implementação da busca + const results = await searchDocs(args.query, args.docsAmount); + return { + content: [{ + type: 'text', + text: JSON.stringify(results) + }] + }; + } +);`} /> + +### Resources (Recursos) + +Resources são dados estruturados que podem ser lidos pelo cliente, similar a arquivos. Eles usam URIs para identificação: + + ({ + contents: [{ + uri: 'azion://static-site/deploy/step-0-preparation', + name: 'step-0-preparation.md', + mimeType: 'text/markdown', + text: guideContent + }] + }) +);`} /> + +URIs de recursos seguem o formato: `azion://[categoria]/[recurso]/[item]` + +### Prompts + +Prompts são templates pré-configurados que ajudam em cenários comuns: + + { + return { + messages: [{ + role: 'user', + content: { + type: 'text', + text: 'Ajude-me a fazer deploy de um site ' + args.framework + ' na Azion' + } + }] + }; + } +);`} /> + +--- + +## Implementação de um Servidor MCP + +Para implementar seu próprio servidor MCP, siga estes passos: + +### Estrutura do Projeto + + + +### Ponto de Entrada + +O arquivo principal inicializa o servidor e registra as capacidades: + + { + return server.handleRequest(request); + } +};`} /> + +### Autenticação + +O servidor MCP suporta múltiplos métodos de autenticação: + + { + const authHeader = request.headers.get('Authorization'); + + if (!authHeader) { + return { success: false, error: 'Token não fornecido' }; + } + + const token = authHeader.replace('Bearer ', ''); + + // Verificar Personal Token (formato: azion + 35 chars) + if (token.startsWith('azion') && token.length === 40) { + return validatePersonalToken(token); + } + + // Verificar OAuth token via SSO + return validateOAuthToken(token); +}`} /> + +--- + +## Deploy na Azion + +O servidor MCP pode ser deployado como uma Edge Function na Azion: + +### Configuração + +Crie um arquivo `azion.config.ts` na raiz do projeto: + + + +### Deploy + +Use o Azion CLI para fazer deploy: + + + +O deploy cria uma URL acessível publicamente que pode ser configurada nos clientes MCP. + +--- + +## Boas Práticas + +### Design de Tools + +1. **Nomes descritivos**: Use verbos e substantivos claros (ex: `search_docs`, `create_rule`) +2. **Parâmetros tipados**: Defina schemas JSON Schema completos +3. **Descrições claras**: Explique quando e como usar cada tool +4. **Tratamento de erros**: Retorne mensagens de erro informativas +5. **Idempotência**: Tools devem ser seguras para múltiplas chamadas + +### Performance + +1. **Cache de respostas**: Implemente cache para dados frequentemente acessados +2. **Paginação**: Use paginação para grandes conjuntos de dados +3. **Timeouts**: Defina timeouts apropriados para operações longas +4. **Compressão**: Comprima respostas grandes + +### Segurança + +1. **Validação de entrada**: Sempre valide parâmetros de entrada +2. **Rate limiting**: Implemente limites de taxa por token +3. **Logs de auditoria**: Registre todas as operações sensíveis +4. **Sanitização**: Remova dados sensíveis antes de retornar + +--- + +## Exemplo Completo + +Veja um exemplo completo de tool para buscar documentação: + + + +--- + +## Recursos Adicionais + +- [Especificação MCP](https://modelcontextprotocol.io) - Documentação oficial do protocolo +- [MCP SDK](https://github.com/modelcontextprotocol/typescript-sdk) - SDK TypeScript oficial +- [Repositório Azion MCP](https://github.com/aziontech/azion-copilot-api) - Código-fonte do servidor Azion +- [Visão Geral do MCP](/pt-br/documentacao/devtools/mcp/) - Introdução ao MCP +- [Guia de Configuração](/pt-br/documentacao/devtools/mcp/configuracao/) - Configure seu ambiente +- [Exemplos Práticos](/pt-br/documentacao/devtools/mcp/exemplos/) - Casos de uso reais diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx index ab602606ee..a54ad87b0d 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-configuracao.mdx @@ -5,7 +5,7 @@ description: >- com vários assistentes de código e ferramentas de desenvolvimento. meta_tags: 'mcp, configuração, claude, cursor, windsurf, setup' namespace: documentation_devtools_mcp_configuration -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentacao/devtools/mcp/configuracao/ --- diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx index 1ba2c59a72..0260c0e00d 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-desenvolvimento-local.mdx @@ -5,7 +5,7 @@ description: >- incluindo clonagem, build e deploy de sua própria instância. meta_tags: 'mcp, desenvolvimento local, setup, deployment, contribuição' namespace: documentation_devtools_mcp_local_development -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentacao/devtools/mcp/desenvolvimento-local/ --- diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx index e3198cb941..f84a50f135 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-exemplos.mdx @@ -5,7 +5,7 @@ description: >- com assistentes de código IA para otimizar o desenvolvimento na Plataforma Azion. meta_tags: 'mcp, exemplos, fluxos de trabalho, deploy, graphql, rules engine' namespace: documentation_devtools_mcp_examples -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentacao/devtools/mcp/exemplos/ --- @@ -263,7 +263,7 @@ O servidor MCP fornece orientação especializada para: - **Vue.js**: Otimização de build, configuração de history mode - **Angular**: Builds de produção, service workers - **Astro**: Modos estático e SSR, integrações -- **Remix**: Deploy edge, carregamento de dados +- **Remix**: Deploy, carregamento de dados - **SvelteKit**: Configuração de adapter, endpoints ### Exemplo: Next.js com ISR diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx index 65a81844d5..85dfff5e90 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-overview.mdx @@ -5,7 +5,7 @@ description: >- habilitando assistência inteligente para deploy, configuração e tarefas de gerenciamento. meta_tags: 'mcp, ia, assistente de código, claude, cursor, windsurf, integração' namespace: documentation_devtools_mcp -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentacao/devtools/mcp/ --- @@ -80,6 +80,7 @@ Para clientes que suportam o MCP Resources Protocol, os seguintes recursos estã ## Recursos relacionados +- [Como o MCP Funciona](/pt-br/documentacao/devtools/mcp/como-funciona/) - [Guia de Configuração MCP](/pt-br/documentacao/devtools/mcp/configuracao/) - [Exemplos MCP](/pt-br/documentacao/devtools/mcp/exemplos/) - [Solução de Problemas MCP](/pt-br/documentacao/devtools/mcp/solucao-de-problemas/) diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx index 490b458ffa..dccb1a7949 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-solucao-de-problemas.mdx @@ -5,7 +5,7 @@ description: >- com a Plataforma Azion e assistentes de código. meta_tags: 'mcp, solução de problemas, erros, debug, soluções' namespace: documentation_devtools_mcp_troubleshooting -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentacao/devtools/mcp/solucao-de-problemas/ --- diff --git a/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx b/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx index 6b1b61c131..04758578d4 100644 --- a/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx +++ b/src/content/docs/pt-br/pages/devtools/mcp/mcp-teste-cache.mdx @@ -5,13 +5,13 @@ description: >- na Plataforma Azion usando ferramentas MCP e comandos cURL. meta_tags: 'mcp, cache, teste, debug, otimização, performance' namespace: documentation_devtools_mcp_cache_testing -menu_namespace: devtoolsMenu +menu_namespace: mcpMenu permalink: /documentacao/devtools/mcp/teste-cache/ --- import Code from '~/components/Code/Code.astro' -Este guia fornece métodos para testar, debugar e otimizar o comportamento de cache na Plataforma Edge da Azion usando ferramentas MCP e comandos cURL diretos. +Este guia fornece métodos para testar, debugar e otimizar o comportamento de cache na Plataforma da Azion usando ferramentas MCP e comandos cURL diretos. --- @@ -37,7 +37,7 @@ Habilite os headers de debug de cache incluindo `Pragma: azion-debug-cache` em s ## Teste básico de cache com cURL -### Testar domínio edge da Azion +### Testar domínio Azion Sempre comece testando o domínio `.map.azionedge.net` diretamente: @@ -60,9 +60,9 @@ curl -H "Pragma: azion-debug-cache" -I "https://seudominio.com/image.jpg?version # Testar com cookies curl -H "Pragma: azion-debug-cache" -H "Cookie: session_id=abc123" -I "https://seudominio.com/"`} /> -### Testar domínio de produção via edge Azion +### Testar domínio de produção via Azion -/dev/null | g ## Teste de performance de cache -### Teste consistente de localização edge +### Teste consistente de localização -Fixe o IP para garantir que ambas as requisições vão para o mesmo servidor edge: +Fixe o IP para garantir que ambas as requisições vão para o mesmo servidor: Isso fornece: - Seu IP público (útil para buscar nos logs Azion) - Resolver DNS sendo usado -- Localização edge Azion servindo a requisição +- Localização Azion servindo a requisição - Status de saúde da rede --- @@ -400,7 +400,7 @@ curl -H "Cookie: user_id=456" "https://seudominio.com/profile" 5. **Use stale-while-revalidate** para melhor disponibilidade 6. **Monitore taxas de cache hit** e otimize configurações 7. **Purgue estrategicamente** usando wildcards e chaves de cache -8. **Teste de múltiplas localizações edge** usando conexões IP diretas +8. **Teste de múltiplas localizações** usando conexões IP diretas 9. **Automatize verificações de saúde do cache** com scripts shell 10. **Meça diferenças de performance** entre requisições cacheadas e não-cacheadas diff --git a/src/content/docs/pt-br/pages/guias/mcp/create-mcp.mdx b/src/content/docs/pt-br/pages/guias/mcp/create-mcp.mdx index 74620a8c0a..46acfb8a35 100644 --- a/src/content/docs/pt-br/pages/guias/mcp/create-mcp.mdx +++ b/src/content/docs/pt-br/pages/guias/mcp/create-mcp.mdx @@ -31,14 +31,14 @@ O transporte usado neste guia é `StreamableHTTPServerTransport`. Para transport O servidor pode ser implementado com uma das seguintes opções: -`McpServer` (alto nível): simplifica o registro de ferramentas, recursos e prompts. -`Server` (baixo nível): fornece controle detalhado implementando manipuladores de requisições diretamente. +- `McpServer` (alto nível): simplifica o registro de ferramentas, recursos e prompts. +- `Server` (baixo nível): fornece controle detalhado implementando manipuladores de requisições diretamente. ### Criando uma Function 1. [Acesse o Azion Console](https://console.azion.com). -2. No canto superior esquerdo, selecione **Functions** +2. No menu do canto superior esquerdo, selecione **Functions** 3. Clique em **+ Function**. 4. Escolha um nome para sua Função. 5. Selecione o ambiente de execução **Application**. diff --git a/src/data/availableMenu.ts b/src/data/availableMenu.ts index 2d8569e1ec..4767b19787 100644 --- a/src/data/availableMenu.ts +++ b/src/data/availableMenu.ts @@ -10,5 +10,6 @@ export const availableMenus = [ { name: 'observeMenu', langs: ['en', 'pt-br'] }, { name: 'deployMenu', langs: ['en', 'pt-br'] }, { name: 'storeMenu', langs: ['en', 'pt-br'] }, - { name: 'libMenu', langs: ['en', 'pt-br'] } + { name: 'libMenu', langs: ['en', 'pt-br'] }, + { name: 'mcpMenu', langs: ['en', 'pt-br'] } ] diff --git a/src/i18n/en/devtoolsMenu.ts b/src/i18n/en/devtoolsMenu.ts index 9d13d3e6d7..8e83675e55 100644 --- a/src/i18n/en/devtoolsMenu.ts +++ b/src/i18n/en/devtoolsMenu.ts @@ -18,6 +18,7 @@ { text: 'Azion Lib', header: true, anchor: true, type: 'learn', key: 'devtools/azionlib', slug: '/documentation/products/azion-lib/overview/'}, { text: 'CLI', header: true, anchor: true, type: 'learn', key: 'devtools/cli', slug: '/documentation/products/azion-cli/overview/' }, { text: 'Console Kit', header: true, anchor: true, type: 'learn', slug: '/documentation/devtools/console-kit/', key: 'devtools/consoleKit' }, + { text: 'MCP', header: true, anchor: true, type: 'learn', slug: '/documentation/devtools/mcp/', key: 'devtools/mcp' }, { text: 'SDK',header: true, anchor: true, type: 'learn', slug: '/documentation/devtools/sdk/go/', key: 'devtools/sdk' }, { text: 'Terraform', header: true, anchor: true, type: 'learn', slug: '/documentation/products/terraform-provider/', key: 'devtools/terraform' }, diff --git a/src/i18n/en/mcpMenu.ts b/src/i18n/en/mcpMenu.ts new file mode 100644 index 0000000000..e9714491a4 --- /dev/null +++ b/src/i18n/en/mcpMenu.ts @@ -0,0 +1,23 @@ +/** + * This configures the navigation sidebar. + * All other languages follow this ordering/structure and will fall back to + * English for any entries they haven't translated. + * + * - All entries MUST include `text` and `key` + * - Heading entries MUST include `header: true` and `type` + * - Link entries MUST include `slug` (which excludes the language code) + */ +export default [ + { text: 'Documentation', header: true, onlyMobile: true, anchor: true, slug: '/documentation/', key: 'documentation' }, + { text: 'Guides', header: true, onlyMobile: true, anchor: true, slug: '/documentation/guides/', key: 'guides' }, + { text: 'Dev Tools', header: true, onlyMobile: true, anchor: true, slug: '/documentation/devtools/', key: 'devTools' }, + + /// START HERE :::: DO NOT REMOVE the strings above, it's a work around for header on mobile /// + + { text: 'Overview', header: true, anchor: true, type: 'learn', key: 'overview', slug: '/documentation/devtools/mcp/' }, + { text: 'How it works', header: true, anchor: true, type: 'learn', key: 'howItWorks', slug: '/documentation/devtools/mcp/how-it-works/' }, + { text: 'Configuration', header: true, anchor: true, type: 'learn', key: 'configuration', slug: '/documentation/devtools/mcp/configuration/' }, + { text: 'Examples', header: true, anchor: true, type: 'learn', key: 'examples', slug: '/documentation/devtools/mcp/examples/' }, + { text: 'Local Development', header: true, anchor: true, type: 'learn', key: 'localDevelopment', slug: '/documentation/devtools/mcp/local-development/' }, + { text: 'Troubleshooting', header: true, anchor: true, type: 'learn', key: 'troubleshooting', slug: '/documentation/devtools/mcp/troubleshooting/' }, +] as const; diff --git a/src/i18n/pt-br/devtoolsMenu.ts b/src/i18n/pt-br/devtoolsMenu.ts index 18fcebd1e2..d9cca53775 100644 --- a/src/i18n/pt-br/devtoolsMenu.ts +++ b/src/i18n/pt-br/devtoolsMenu.ts @@ -18,6 +18,7 @@ { text: 'Azion Lib', header: true, anchor: true, type: 'learn', key: 'devtools/azionlib', slug: '/documentacao/produtos/azion-lib/visao-geral/' }, { text: 'CLI', header: true, anchor: true, type: 'learn', key: 'devtools/cli', slug: 'documentacao/produtos/azion-cli/visao-geral' }, { text: 'Console Kit', header: true, anchor: true, type: 'learn', slug: '/documentacao/devtools/console-kit/', key: 'devtools/consoleKit' }, + { text: 'MCP', header: true, anchor: true, type: 'learn', slug: '/documentacao/devtools/mcp/', key: 'devtools/mcp' }, { text: 'SDK',header: true, anchor: true, type: 'learn', slug: '/documentacao/devtools/sdk/go/', key: 'devtools/sdk' }, { text: 'Terraform', header: true, anchor: true, type: 'learn', slug: '/documentacao/produtos/terraform-provider/', key: 'devtools/terraform' }, diff --git a/src/i18n/pt-br/mcpMenu.ts b/src/i18n/pt-br/mcpMenu.ts new file mode 100644 index 0000000000..528988e07a --- /dev/null +++ b/src/i18n/pt-br/mcpMenu.ts @@ -0,0 +1,23 @@ +/** + * This configures the navigation sidebar. + * All other languages follow this ordering/structure and will fall back to + * English for any entries they haven't translated. + * + * - All entries MUST include `text` and `key` + * - Heading entries MUST include `header: true` and `type` + * - Link entries MUST include `slug` (which excludes the language code) + */ +export default [ + { text: 'Documentação', header: true, onlyMobile: true, anchor: true, slug: '/documentacao/', key: 'documentation' }, + { text: 'Guias',header: true, onlyMobile: true, anchor: true, slug: '/documentacao/produtos/guias/', key: 'guides' }, + { text: 'Dev Tools',header: true, onlyMobile: true, anchor: true, slug: '/documentacao/produtos/dev-tools/', key: 'devTools' }, + + /// START HERE :::: DO NOT REMOVE the strings above, it's a work around for header on mobile /// + + { text: 'Visão geral', header: true, anchor: true, type: 'learn', key: 'overview', slug: '/documentacao/devtools/mcp/' }, + { text: 'Como funciona', header: true, anchor: true, type: 'learn', key: 'howItWorks', slug: '/documentacao/devtools/mcp/como-funciona/' }, + { text: 'Configuração', header: true, anchor: true, type: 'learn', key: 'configuration', slug: '/documentacao/devtools/mcp/configuracao/' }, + { text: 'Exemplos', header: true, anchor: true, type: 'learn', key: 'examples', slug: '/documentacao/devtools/mcp/exemplos/' }, + { text: 'Desenvolvimento local', header: true, anchor: true, type: 'learn', key: 'localDevelopment', slug: '/documentacao/devtools/mcp/desenvolvimento-local/' }, + { text: 'Solução de problemas', header: true, anchor: true, type: 'learn', key: 'troubleshooting', slug: '/documentacao/devtools/mcp/solucao-de-problemas/' }, +] as const;