Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(mcp): add OpenAI ChatGPT Apps Directory submission package (#8433)

Eric Hayes48083c9ad95f
diff --git a/services/mcp_service/AGENTS.md b/services/mcp_service/AGENTS.md
index ff9625d1c0..8af3d43ac7 100644
--- a/services/mcp_service/AGENTS.md
+++ b/services/mcp_service/AGENTS.md
@@ -11,14 +11,20 @@ FusionAuth.
- `src/main.rs`: composition root — builds `McpAuthProxyService`
(from `mcp_auth_proxy`), the `rmcp` streamable HTTP transport, and
- `AuthenticatedToolService`.
+ `AuthenticatedToolService`. Also includes the OpenAI domain verification
+ endpoint at `/.well-known/openai-apps-challenge`.
- `src/tool_service.rs`: `ServerHandler` impl — extracts the authenticated
user from request parts and maps `ai_toolset` tools/annotations onto the
MCP wire format.
- `src/config.rs`: typed env vars (`macro_config`/`macro_env_var` pattern),
- including `DEFAULT_MCP_ALLOWED_REDIRECT_HOSTS`.
+ including `DEFAULT_MCP_ALLOWED_REDIRECT_HOSTS` and
+ `OPENAI_DOMAIN_VERIFICATION_TOKEN`.
- `src/markdown_images.rs`: resolves markdown image references in tool output.
- `src/tool_response.rs`: shapes tool results (incl. media) for MCP responses.
+- `OPENAI_SUBMISSION.md`: comprehensive submission guide for the OpenAI ChatGPT
+ Apps Directory.
+- `OPENAI_SUBMISSION.json`: machine-readable submission manifest with field
+ values.
## Scope
@@ -47,6 +53,10 @@ FusionAuth.
- Allow a new MCP client origin: `src/config.rs`
(`DEFAULT_MCP_ALLOWED_REDIRECT_HOSTS`) — see `mcp_auth_proxy/README.md` for
the redirect URI policy this feeds.
+- Submit to OpenAI ChatGPT Apps Directory: follow `OPENAI_SUBMISSION.md` →
+ complete organization verification and demo account setup → obtain domain
+ verification token and set `OPENAI_DOMAIN_VERIFICATION_TOKEN` env var →
+ submit via OpenAI portal.
## Tool contracts
diff --git a/services/mcp_service/OPENAI_SUBMISSION.json b/services/mcp_service/OPENAI_SUBMISSION.json
new file mode 100644
index 0000000000..d5a450bd95
--- /dev/null
+++ b/services/mcp_service/OPENAI_SUBMISSION.json
@@ -0,0 +1,347 @@
+{
+ "plugin_name": "Macro",
+ "submission_metadata": {
+ "owner": "Eric Hayes",
+ "owner_email": "[email protected]",
+ "owner_github": "ehayes2000",
+ "submission_date": "October 2026",
+ "status": "ready_for_submission_after_human_review"
+ },
+ "listing": {
+ "name": "Macro",
+ "short_description": "Search, read, and create content across documents, emails, and messages in Macro.",
+ "long_description": "Macro is a unified workspace that brings together email, chat, tasks, documents, agents, and CRM in one place. This MCP server provides tools for interacting with your Macro workspace: search across all content, read and create documents, manage channels and messages, access agent sessions, query databases, create calendar events, send emails, and more. Macro enables AI clients to seamlessly work with your company's knowledge base and workflows.",
+ "category": "Productivity",
+ "website": "https://macro.com",
+ "support_url": "mailto:[email protected]",
+ "privacy_policy_url": "https://macro.com/privacy",
+ "terms_url": "https://macro.com/terms"
+ },
+ "assets": {
+ "logo_source_svg": "/workspace/apps/web/public/macro-favicon.svg",
+ "logo_alt_source": "/workspace/apps/web/src/components/icon/macro-logo.svg",
+ "required_sizes": [
+ "512x512px PNG",
+ "256x256px PNG",
+ "128x128px PNG",
+ "SVG (any size)"
+ ],
+ "status": "TODO: Export and upload assets"
+ },
+ "mcp_server": {
+ "url": "https://mcp-server.macro.com/mcp",
+ "transport": "Streamable HTTP (SSE)",
+ "authentication": {
+ "type": "OAuth 2.1",
+ "provider": "FusionAuth",
+ "authorization_endpoint": "https://auth.macro.com/oauth2/authorize",
+ "token_endpoint": "https://auth.macro.com/oauth2/token",
+ "supported_flows": [
+ "authorization_code",
+ "dynamic_client_registration"
+ ],
+ "scopes": [
+ "full_workspace_access"
+ ],
+ "allowed_redirect_hosts": [
+ "chatgpt.com",
+ "chat.openai.com",
+ "claude.ai",
+ "cursor.com",
+ "www.cursor.com"
+ ]
+ },
+ "domain_verification": {
+ "endpoint": "https://mcp-server.macro.com/.well-known/openai-apps-challenge",
+ "implementation": "Axum route handler",
+ "env_var": "OPENAI_DOMAIN_VERIFICATION_TOKEN",
+ "status": "IMPLEMENTED - Needs token from OpenAI portal"
+ },
+ "deployment": {
+ "platform": "AWS ECS Fargate",
+ "region": "us-east-1",
+ "autoscaling": {
+ "min": 1,
+ "max": 10
+ },
+ "load_balancer": "Application Load Balancer",
+ "monitoring": "Datadog + OpenTelemetry"
+ }
+ },
+ "test_credentials": {
+ "status": "TODO: Create demo account",
+ "requirements": [
+ "Fully-featured demo account with sample data",
+ "No MFA or 2FA",
+ "No SMS verification",
+ "Permanent password",
+ "Sample content: documents, emails, channels, calendar, CRM, databases, agents"
+ ]
+ },
+ "example_prompts": [
+ "Search my workspace for documents about Q4 planning",
+ "Create a new document called 'Meeting Notes' and add today's standup highlights",
+ "What are the latest messages in the #engineering channel?",
+ "Send an email to the team with this week's progress update",
+ "Show me upcoming calendar events for the next 7 days",
+ "Query the customers database for contacts in California",
+ "Read the most recent agent session about the product launch",
+ "Create a new CRM contact for Acme Corp with contact details",
+ "What skills are available to help with marketing tasks?",
+ "Share the product roadmap document with the #product channel"
+ ],
+ "test_cases": {
+ "positive": [
+ {
+ "name": "Search and Read Document",
+ "prompt": "Search for documents about 'onboarding' and read the first result",
+ "expected_tools": [
+ "ContentSearch",
+ "ReadContent"
+ ],
+ "expected_outcome": "Document content displayed with proper formatting"
+ },
+ {
+ "name": "Create and Share Document",
+ "prompt": "Create a new document called 'Team Updates October 2026' with the heading 'Weekly Updates', then share it with the #general channel",
+ "expected_tools": [
+ "CreateDocument",
+ "ShareWithChannel"
+ ],
+ "expected_outcome": "Confirmation that document was created and shared successfully"
+ },
+ {
+ "name": "Read Channel Messages",
+ "prompt": "What are the last 5 messages in the #engineering channel?",
+ "expected_tools": [
+ "ReadChannelMessages"
+ ],
+ "expected_outcome": "List of 5 recent messages with sender, timestamp, and content"
+ },
+ {
+ "name": "Calendar Event Creation",
+ "prompt": "Create a calendar event for 'Sprint Planning' tomorrow at 2pm for 1 hour",
+ "expected_tools": [
+ "CreateCalendarEvent"
+ ],
+ "expected_outcome": "Confirmation with event ID and calendar link"
+ },
+ {
+ "name": "Database Query",
+ "prompt": "Query the contacts database for all people with email addresses from @acme.com",
+ "expected_tools": [
+ "QueryDatabase"
+ ],
+ "expected_outcome": "Table of contacts with Acme Corp email addresses"
+ }
+ ],
+ "negative": [
+ {
+ "name": "Invalid Document ID",
+ "prompt": "Read document with ID 00000000-0000-0000-0000-000000000000",
+ "expected_tools": [
+ "ReadContent"
+ ],
+ "expected_outcome": "Clear error message: 'Document not found' or 'Access denied'"
+ },
+ {
+ "name": "Permission Denied",
+ "prompt": "Delete the document 'Company Financials Q4 2026'",
+ "expected_tools": [
+ "MoveToTrash"
+ ],
+ "expected_outcome": "Permission error if user lacks delete access"
+ },
+ {
+ "name": "Malformed Query",
+ "prompt": "Query the database with SQL: SELECT * FROM nonexistent_table",
+ "expected_tools": [
+ "QueryDatabase"
+ ],
+ "expected_outcome": "SQL error message without crashing: 'Table does not exist'"
+ }
+ ]
+ },
+ "tools_summary": {
+ "total_count": "60+",
+ "categories": {
+ "search_discovery": {
+ "count": 8,
+ "examples": [
+ "ContentSearch",
+ "NameSearch",
+ "ListEntities",
+ "SearchSkills"
+ ]
+ },
+ "documents": {
+ "count": 8,
+ "examples": [
+ "ReadContent",
+ "CreateDocument",
+ "EditDocument",
+ "ReadSpreadsheet"
+ ]
+ },
+ "channels_communication": {
+ "count": 6,
+ "examples": [
+ "ReadChannelMessages",
+ "SendChannelMessage",
+ "ShareWithChannel"
+ ]
+ },
+ "email": {
+ "count": 3,
+ "examples": [
+ "ReadEmail",
+ "SendEmail",
+ "SearchEmail"
+ ]
+ },
+ "calendar_scheduling": {
+ "count": 6,
+ "examples": [
+ "CreateCalendarEvent",
+ "ListCalendars",
+ "CreateBookingLink"
+ ]
+ },
+ "agent_sessions": {
+ "count": 3,
+ "examples": [
+ "ReadAgentSession",
+ "UpdateAgentSessionSharing"
+ ]
+ },
+ "database_crm": {
+ "count": 8,
+ "examples": [
+ "QueryDatabase",
+ "CreateCrmContact",
+ "ListCrmPipelines"
+ ]
+ },
+ "projects_organization": {
+ "count": 7,
+ "examples": [
+ "CreateProject",
+ "MoveToProject",
+ "MoveToTrash"
+ ]
+ },
+ "skills": {
+ "count": 3,
+ "examples": [
+ "ReadSkill",
+ "ListSkills",
+ "SearchSkills"
+ ]
+ },
+ "forms": {
+ "count": 2,
+ "examples": [
+ "CreateForm",
+ "SetFormAccess"
+ ]
+ },
+ "properties_tags": {
+ "count": 6,
+ "examples": [
+ "SetEntityProperty",
+ "CreateTag",
+ "DeleteTag"
+ ]
+ }
+ },
+ "annotation_compliance": {
+ "all_tools_annotated": true,
+ "readOnlyHint": "Explicit boolean on all tools",
+ "destructiveHint": "Explicit boolean on all tools",
+ "openWorldHint": "Explicit boolean on all tools",
+ "idempotentHint": "Explicit boolean on all tools",
+ "implementation": "ToolAnnotations trait with compile-time enforcement"
+ }
+ },
+ "openai_requirements": {
+ "organization_verification": {
+ "status": "TODO",
+ "required": "Individual or business verification in OpenAI Platform Dashboard",
+ "contact": "[email protected]"
+ },
+ "api_permissions": {
+ "status": "TODO",
+ "required": [
+ "api.apps.write",
+ "api.apps.read"
+ ]
+ },
+ "domain_verification": {
+ "status": "IMPLEMENTED - Needs token",
+ "endpoint": "/.well-known/openai-apps-challenge",
+ "implementation": "services/mcp_service/src/main.rs"
+ },
+ "tool_annotations": {
+ "status": "PASS",
+ "all_tools_have_annotations": true,
+ "framework": "ai_toolset::ToolAnnotations"
+ },
+ "privacy_policy": {
+ "status": "PASS",
+ "url": "https://macro.com/privacy",
+ "verified": true
+ },
+ "terms_of_service": {
+ "status": "PASS",
+ "url": "https://macro.com/terms",
+ "verified": true
+ },
+ "support_contact": {
+ "status": "PASS",
+ "email": "[email protected]"
+ },
+ "test_credentials": {
+ "status": "TODO",
+ "blocker": "Need to create demo account"
+ },
+ "logo_assets": {
+ "status": "TODO",
+ "blocker": "Need to export in required sizes"
+ }
+ },
+ "submission_readiness": {
+ "overall_status": "80% complete",
+ "blocking_items": [
+ "OpenAI organization verification",
+ "Demo account creation with sample data",
+ "Logo assets export and upload",
+ "Domain verification token from OpenAI portal"
+ ],
+ "completed_items": [
+ "MCP server publicly accessible",
+ "OAuth 2.1 authentication configured",
+ "All tools have required annotations",
+ "Privacy policy and terms accessible",
+ "Support contact available",
+ "Domain verification endpoint implemented",
+ "Example prompts defined",
+ "Test cases defined",
+ "Submission documentation complete"
+ ],
+ "estimated_time_to_complete": "Human action required for verification steps"
+ },
+ "contacts": {
+ "primary": {
+ "name": "Eric Hayes",
+ "email": "[email protected]",
+ "github": "ehayes2000",
+ "role": "Technical Lead"
+ },
+ "company": {
+ "name": "Macro Inc.",
+ "website": "https://macro.com",
+ "support": "[email protected]",
+ "location": "San Francisco, CA"
+ }
+ }
+}
diff --git a/services/mcp_service/OPENAI_SUBMISSION.md b/services/mcp_service/OPENAI_SUBMISSION.md
new file mode 100644
index 0000000000..7a42894593
--- /dev/null
+++ b/services/mcp_service/OPENAI_SUBMISSION.md
@@ -0,0 +1,492 @@
+# OpenAI ChatGPT Apps Directory Submission
+
+## Submission Overview
+
+This document contains all the information required to submit Macro's MCP server to the OpenAI ChatGPT Apps Directory via the ZIP-based plugin package format.
+
+**Owner**: Eric Hayes ([email protected], GitHub: ehayes2000)
+**Submission Date**: October 2026
+**Status**: Ready for submission after icon export
+
+## Quick Start
+
+The plugin package is ready at: `services/mcp_service/openai-plugin-package/`
+
+**Build the submission ZIP:**
+```bash
+cd /workspace/services/mcp_service/openai-plugin-package
+./build-package.sh
+```
+
+**Upload to OpenAI Portal:**
+Upload `services/mcp_service/macro-plugin-v1.0.0.zip` to the [OpenAI Plugin Submission Portal](https://platform.openai.com/plugins)
+
+---
+
+## Plugin Metadata
+
+### Basic Information
+
+- **Plugin Name**: Macro
+- **Short Description**: Search, read, and create content across documents, emails, and messages in Macro.
+- **Long Description**: Macro is a unified workspace that brings together email, chat, tasks, documents, agents, and CRM in one place. This MCP server provides tools for interacting with your Macro workspace: search across all content, read and create documents, manage channels and messages, access agent sessions, query databases, create calendar events, send emails, and more. Macro enables AI clients to seamlessly work with your company's knowledge base and workflows.
+- **Category**: Productivity / Workspace Management
+- **Website**: https://macro.com
+- **Support URL**: mailto:[email protected]
+- **Privacy Policy URL**: https://macro.com/privacy
+- **Terms of Service URL**: https://macro.com/terms
+
+### Logo and Assets
+
+**Logo Files** (need to be prepared in required sizes):
+- Source: `/workspace/apps/web/public/macro-favicon.svg` and `/workspace/apps/web/src/components/icon/macro-logo.svg`
+- Required sizes for submission:
+ - 512x512px PNG (high resolution)
+ - 256x256px PNG
+ - 128x128px PNG
+ - SVG version (any size)
+
+**TODO**: Export logo assets in required sizes and upload to a publicly accessible location or prepare for OpenAI submission portal upload.
+
+---
+
+## MCP Server Details
+
+### Production MCP Server
+
+- **MCP Server URL**: `https://mcp-server.macro.com/mcp`
+- **Transport**: Streamable HTTP (SSE)
+- **Authentication**: OAuth 2.1 backed by FusionAuth
+- **Public Accessibility**: ✅ Yes (deployed to AWS ECS, publicly routable)
+- **Domain Verification**: **TODO** - Host token at `https://mcp-server.macro.com/.well-known/openai-apps-challenge`
+
+### Authentication Details
+
+**OAuth 2.1 Configuration**:
+- **Authorization Endpoint**: `https://auth.macro.com/oauth2/authorize` (FusionAuth public URL)
+- **Token Endpoint**: `https://auth.macro.com/oauth2/token`
+- **Client Registration**: Dynamic Client Registration supported via OAuth 2.1
+- **Scopes**: Full Macro workspace access (read/write across documents, channels, email, databases)
+- **Redirect URI Policy**: Allows `chatgpt.com`, `chat.openai.com` as configured in `DEFAULT_MCP_ALLOWED_REDIRECT_HOSTS`
+
+**Authentication Flow**:
+1. MCP client initiates OAuth flow
+2. User redirects to browser for Macro login
+3. User authorizes the MCP client
+4. FusionAuth returns authorization code
+5. MCP client exchanges code for access token
+6. Subsequent tool calls authenticated via Bearer token
+
+**Credentials Stored**: OAuth credentials encrypted with AES-256 via `McpCredentialsKeySecretName`
+
+### Content Security Policy
+
+**CSP Declaration**: Not currently returning UI components, only tool results. If future versions add UI:
+- CSP should be declared via `_meta.ui.csp.frameDomains` in resource metadata
+- Currently: No iframe embeds, no UI widgets, tool results only
+
+---
+
+## Tool Inventory
+
+The Macro MCP server exposes a comprehensive set of tools across multiple domains. Each tool has been annotated with the required `readOnlyHint`, `destructiveHint`, and `openWorldHint` boolean values.
+
+### Tool Categories
+
+**Search & Discovery** (Read-Only):
+- `ContentSearch` - Search across all content in the workspace
+- `NameSearch` - Search entities by name
+- `SearchTools` - Discover available tools
+- `LoadTools` - Load deferred tool schemas
+- `ListEntities` - Browse recent items
+- `SearchSkills` - Find skills by name
+- `ListSkills` - List available skills
+- `SelfKnowledge` - Get information about the AI assistant's capabilities
+
+**Document Operations**:
+- `ReadContent` - Read document content (Read-Only)
+- `ReadMetadata` - Read document metadata (Read-Only)
+- `CreateDocument` - Create new documents (Additive)
+- `EditDocument` - Edit existing documents (Destructive)
+- `ReadSpreadsheet` - Read spreadsheet data (Read-Only)
+- `EditSpreadsheet` - Modify spreadsheet cells (Destructive)
+- `ReadPresentation` - Read presentation content (Read-Only)
+- `WordDocument` - Create/edit Word documents (Additive/Destructive based on operation)
+
+**Channel & Communication** (Open World where applicable):
+- `ReadChannelMessages` - Read messages from channels (Read-Only)
+- `ReadChannelThread` - Read threaded conversations (Read-Only)
+- `ReadChannelMessageContext` - Get message context (Read-Only)
+- `SendChannelMessage` - Send messages to channels (Additive, Open World)
+- `ShareWithChannel` - Share content to channels (Additive)
+- `CreateChannelMediaUpload` - Upload media to channels (Additive)
+
+**Email** (Open World):
+- `ReadEmail` - Read email messages (Read-Only)
+- `SendEmail` - Send email messages (Additive, Open World)
+- `SearchEmail` - Search email content (Read-Only)
+
+**Calendar & Scheduling**:
+- `ListCalendars` - List user's calendars (Read-Only)
+- `CreateCalendarEvent` - Create calendar events (Additive)
+- `UpdateCalendarEvent` - Modify events (Destructive)
+- `DeleteCalendarEvent` - Delete events (Destructive)
+- `ListBookingLinks` - List booking links (Read-Only)
+- `CreateBookingLink` - Create booking links (Additive)
+
+**Agent Sessions**:
+- `ReadAgentSession` - Read agent conversation transcripts (Read-Only)
+- `ReadAgentSessionSharing` - Get sharing settings (Read-Only)
+- `UpdateAgentSessionSharing` - Modify sharing (Destructive)
+
+**Database & CRM**:
+- `DiscoverDatabases` - List available databases (Read-Only)
+- `QueryDatabase` - Execute SQL queries (Read-Only for SELECT, Destructive for INSERT/UPDATE/DELETE)
+- `ReadCrmContact` - Read CRM contact (Read-Only)
+- `CreateCrmContact` - Create contact (Additive)
+- `UpdateCrmContact` - Update contact (Destructive)
+- `ListCrmPipelines` - List sales pipelines (Read-Only)
+
+**Projects & Organization**:
+- `ListProjects` - List projects/folders (Read-Only)
+- `CreateProject` - Create new project (Additive)
+- `ReadProject` - Read project details (Read-Only)
+- `MoveToProject` - Move items (Destructive)
+- `MoveToTrash` - Delete items (Destructive)
+- `RenameItem` - Rename items (Destructive)
+
+**Skills**:
+- `ReadSkill` - Read skill instructions (Read-Only)
+- `ListSkills` - List available skills (Read-Only)
+- `SearchSkills` - Search for skills (Read-Only)
+
+**Forms**:
+- `CreateForm` - Create forms (Additive)
+- `SetFormAccess` - Modify form permissions (Destructive)
+
+**Properties & Tags**:
+- `GetEntityProperties` - Read properties (Read-Only)
+- `SetEntityProperty` - Set properties (Destructive)
+- `ListTags` - List tags (Read-Only)
+- `CreateTag` - Create tag (Additive)
+- `EditTag` - Modify tag (Destructive)
+- `DeleteTag` - Delete tag (Destructive)
+
+**Import & Integration**:
+- `ImportChannel` - Import Slack/Discord channels (Additive, Open World)
+- `DiscoverConnectors` - List available connectors (Read-Only)
+
+**Coding Agents**:
+- `ReadCodingAgentSession` - Read coding agent transcripts (Read-Only)
+- `ListCodingAgents` - List available coding agents (Read-Only)
+
+### Tool Annotations Summary
+
+All tools in the Macro MCP server implement the required `ToolAnnotated` trait with explicit boolean values:
+
+**readOnlyHint**: Set to `true` for all retrieval, computation, or preview operations (Read*, List*, Search*, Get*, Discover*). Set to `false` for any operation that modifies state (Create*, Edit*, Update*, Delete*, Send*, Set*, Move*).
+
+**destructiveHint**: Set to `false` for read-only tools and additive writes (Create*, Add*). Set to `true` for potentially destructive or irreversible operations (Edit*, Update*, Delete*, Move to trash, Send email/message, Revoke access).
+
+**openWorldHint**: Set to `true` for tools that interact with public internet or send data outside the user's bounded workspace (SendEmail, SendChannelMessage to external channels, Import from external services, web search). Set to `false` for tools confined to the user's private Macro workspace.
+
+**idempotentHint**: Set to `true` for read-only operations. Set appropriately for writes based on whether repeated calls with identical parameters have the same effect.
+
+---
+
+## Test Credentials
+
+**Test Account Requirements**:
+- **Demo Account Email**: **TODO** - Create a fully-featured demo account
+- **Demo Account Password**: **TODO** - Set a permanent password (no MFA)
+- **Account Features**: The demo account should include:
+ - Sample documents with varied content
+ - Sample email threads
+ - Active channels with message history
+ - Calendar events
+ - CRM contacts and deals
+ - Database tables with data
+ - Agent session history
+ - Booking links
+ - Forms
+
+**Access Notes**:
+- Account must be accessible without 2FA, SMS codes, or additional verification
+- Account should persist indefinitely for OpenAI reviewers
+- Account should represent realistic usage with interconnected data
+
+---
+
+## Example Prompts / Starter Prompts
+
+1. "Search my workspace for documents about Q4 planning"
+2. "Create a new document called 'Meeting Notes' and add today's standup highlights"
+3. "What are the latest messages in the #engineering channel?"
+4. "Send an email to the team with this week's progress update"
+5. "Show me upcoming calendar events for the next 7 days"
+6. "Query the customers database for contacts in California"
+7. "Read the most recent agent session about the product launch"
+8. "Create a new CRM contact for Acme Corp with contact details"
+9. "What skills are available to help with marketing tasks?"
+10. "Share the product roadmap document with the #product channel"
+
+---
+
+## Test Cases
+
+### Positive Test Cases (Expected to Succeed)
+
+1. **Search and Read Document**
+ - **Prompt**: "Search for documents about 'onboarding' and read the first result"
+ - **Expected Behavior**:
+ - `ContentSearch` tool called with query "onboarding"
+ - Returns list of matching documents with IDs and snippets
+ - `ReadContent` tool called with document ID
+ - Returns full markdown content of the document
+ - **Expected Output**: Document content displayed with proper formatting
+
+2. **Create and Share Document**
+ - **Prompt**: "Create a new document called 'Team Updates October 2026' with the heading 'Weekly Updates', then share it with the #general channel"
+ - **Expected Behavior**:
+ - `CreateDocument` tool creates document with specified name and content
+ - Returns document ID
+ - `ShareWithChannel` tool shares document to #general channel
+ - **Expected Output**: Confirmation that document was created and shared successfully
+
+3. **Read Channel Messages**
+ - **Prompt**: "What are the last 5 messages in the #engineering channel?"
+ - **Expected Behavior**:
+ - `ReadChannelMessages` tool called with channel identifier and limit=5
+ - Returns message history with sender, timestamp, and content
+ - **Expected Output**: List of 5 recent messages with metadata
+
+4. **Calendar Event Creation**
+ - **Prompt**: "Create a calendar event for 'Sprint Planning' tomorrow at 2pm for 1 hour"
+ - **Expected Behavior**:
+ - `CreateCalendarEvent` tool called with event details
+ - Event created in user's default calendar
+ - **Expected Output**: Confirmation with event ID and calendar link
+
+5. **Database Query**
+ - **Prompt**: "Query the contacts database for all people with email addresses from @acme.com"
+ - **Expected Behavior**:
+ - `QueryDatabase` tool called with SQL query filtering by email domain
+ - Returns result rows matching the criteria
+ - **Expected Output**: Table of contacts with Acme Corp email addresses
+
+### Negative Test Cases (Expected to Fail Gracefully)
+
+1. **Invalid Document ID**
+ - **Prompt**: "Read document with ID 00000000-0000-0000-0000-000000000000"
+ - **Expected Behavior**:
+ - `ReadContent` tool called with invalid/non-existent document ID
+ - Tool returns error: "Document not found" or "Access denied"
+ - **Expected Output**: Clear error message without exposing internal details
+
+2. **Permission Denied**
+ - **Prompt**: "Delete the document 'Company Financials Q4 2026'" (assuming user lacks permission)
+ - **Expected Behavior**:
+ - Tool attempts to delete document
+ - Returns permission error if user lacks delete access
+ - **Expected Output**: "You don't have permission to delete this document" or similar
+
+3. **Malformed Query**
+ - **Prompt**: "Query the database with SQL: SELECT * FROM nonexistent_table"
+ - **Expected Behavior**:
+ - `QueryDatabase` tool executes query
+ - Database returns error for non-existent table
+ - **Expected Output**: SQL error message: "Table does not exist" without crashing
+
+---
+
+## Domain Verification
+
+**TODO - Required Action**: Host the domain verification token at:
+```
+https://mcp-server.macro.com/.well-known/openai-apps-challenge
+```
+
+**Implementation**: Add an endpoint in `services/mcp_service/src/main.rs` or via nginx/CDN that serves the OpenAI-provided challenge token as plain text at the well-known path.
+
+**Verification Steps**:
+1. Obtain verification token from OpenAI submission portal
+2. Create endpoint or static file at `.well-known/openai-apps-challenge`
+3. Verify token is accessible via HTTPS GET request
+4. Confirm in submission portal that verification succeeds
+
+---
+
+## Reviewer Notes
+
+### Architecture Overview
+
+Macro's MCP server is a Rust-based service deployed on AWS ECS Fargate, serving tools via the Streamable HTTP (SSE) transport specified by the MCP protocol. Authentication is handled through OAuth 2.1 backed by FusionAuth, with credentials encrypted using AES-256.
+
+The service is built on a hexagonal architecture with clear separation between domain logic, inbound adapters (HTTP/MCP transport), and outbound adapters (database, external services). All tools are implemented in their respective domain crates and assembled into a unified toolset in the `ai_tools` crate.
+
+### Key Technical Details
+
+- **Language**: Rust (stable)
+- **Transport**: Streamable HTTP (rmcp library)
+- **Authentication**: OAuth 2.1 with FusionAuth
+- **Database**: PostgreSQL (MacroDB)
+- **Telemetry**: OpenTelemetry with Datadog integration
+- **Deployment**: AWS ECS Fargate behind Application Load Balancer
+- **Autoscaling**: Configured for 1-10 tasks (dev: 1-3) based on CPU/memory/request count
+
+### Privacy & Security
+
+- OAuth credentials are encrypted at rest using AES-256
+- All tool operations are scoped to the authenticated user's permissions
+- Implements standard entity access control via `entity_access` crate
+- Complies with Macro's privacy policy at https://macro.com/privacy
+- ISO 27001 and SOC 2 certified
+- Tool responses minimize data collection and return only request-relevant information
+
+### Tool Response Format
+
+All tools return structured JSON responses that include:
+- Primary result data
+- Optional `_meta` fields for UI rendering hints
+- Media attachments (images, videos) with inline data URIs or downloadable URLs
+- Markdown formatting for rich text content
+- Links to Macro web app items (documents, channels, contacts) using the `APP_BASE_URL` config
+
+### Known Limitations
+
+- No UI widgets currently implemented (tool results only)
+- Some legacy tools from chat interface not exposed to MCP
+- Subagent tool not available to MCP clients (recursive agent creation restricted)
+- DisplayResults tool omitted for MCP (clients handle their own display)
+
+---
+
+## Pre-Submission Checklist
+
+- [ ] **Organization Verification**: Complete identity verification in OpenAI Platform Dashboard
+ - Individual verification for [email protected] OR
+ - Business verification for Macro Inc.
+- [ ] **API Permissions**: Ensure `api.apps.write` and `api.apps.read` permissions granted
+- [ ] **Domain Verification**: Host challenge token at `/.well-known/openai-apps-challenge`
+- [ ] **Logo Assets**: Export and upload logo in required sizes (512px, 256px, 128px, SVG)
+- [ ] **Test Account**: Create and configure fully-featured demo account with no MFA
+- [ ] **Test Credentials**: Document test account email and password
+- [ ] **Privacy Policy**: Verify https://macro.com/privacy is accessible and current
+- [ ] **Terms of Service**: Verify https://macro.com/terms is accessible and current
+- [ ] **Support Contact**: Confirm [email protected] is monitored
+- [ ] **Tool Scanning**: Run `Scan Tools` in submission portal and verify all annotations
+- [ ] **Test Cases**: Validate all 5 positive and 3 negative test cases in production
+- [ ] **Example Prompts**: Test all 10 starter prompts for correctness
+
+---
+
+## Submission Instructions
+
+### Step 1: Pre-Submission Preparation
+
+1. Complete organization verification in [OpenAI Platform Dashboard](https://platform.openai.com)
+2. Export logo assets in required sizes
+3. Create demo account with sample data
+4. Implement domain verification endpoint
+5. Deploy any required changes to production
+
+### Step 2: Portal Submission
+
+1. Navigate to [Plugin Submission Portal](https://developers.openai.com/plugins)
+2. Click "Create Plugin" or "Submit Plugin"
+3. Enter MCP Server URL: `https://mcp-server.macro.com/mcp`
+4. Configure OAuth 2.1 authentication settings
+5. Click "Scan Tools" to import tool metadata
+6. Review discovered tools and annotations
+7. Fill in all required fields:
+ - Plugin name: Macro
+ - Short description (see above)
+ - Long description (see above)
+ - Category: Productivity
+ - Logo upload
+ - Website, support, privacy, terms URLs
+ - Test credentials
+ - Example prompts
+ - Test cases (5 positive, 3 negative)
+ - Localization: English (US)
+8. Confirm all checkboxes
+9. Submit for review
+
+### Step 3: Post-Submission
+
+1. Monitor email for review updates
+2. Respond to any feedback or requests for changes
+3. If rejected, review feedback, make changes, and resubmit
+4. If approved, click "Publish" to make plugin available in directory
+5. Monitor user reports and maintain plugin per OpenAI requirements
+
+---
+
+## Maintenance Plan
+
+### Continuous Review
+
+OpenAI will periodically scan the MCP server and compare tools with published definitions. Changes are automatically reviewed:
+
+- **New tools**: Available after passing automated checks
+- **Updated tools**: Previous definition stays live until update passes checks
+- **Deleted tools**: Removed immediately upon detection
+
+### Version Updates
+
+For changes requiring new plugin version submission:
+- Updated plugin metadata (name, description, logo)
+- MCP server origin change (scheme, hostname, or port)
+- Major tool contract changes
+
+For changes handled via continuous review:
+- Individual tool additions, updates, or removals
+- Tool schema changes
+- Tool annotation updates
+- Server instructions updates
+- CSP changes (if UI added in future)
+
+### Monitoring
+
+- Monitor MCP server health via Datadog
+- Track tool call success/failure rates
+- Monitor user feedback via OpenAI plugin directory
+- Respond to reported issues within 48 hours
+- Keep demo account active and accessible
+
+---
+
+## Contact Information
+
+**Primary Contact**:
+- Name: Eric Hayes
+- GitHub: ehayes2000
+- Role: Technical Lead
+
+**Company**:
+- Name: Macro Inc.
+- Website: https://macro.com
+- Support: [email protected]
+- Location: San Francisco, CA
+
+**Engineering**:
+- MCP Service Source: `/workspace/services/mcp_service/`
+- Infrastructure: `/workspace/infra/stacks/mcp-server/`
+- Tool Implementations: `/workspace/crates/ai_tools/`
+
+---
+
+## Additional Resources
+
+- [Macro Documentation](https://docs.macro.com)
+- [MCP Setup Guide](https://docs.macro.com/AI/mcp/overview)
+- [OpenAI Apps SDK Documentation](https://developers.openai.com/apps-sdk)
+- [Plugin Guidelines](https://developers.openai.com/plugins/plugin-guidelines)
+- [MCP Protocol Specification](https://modelcontextprotocol.io)
+
+---
+
+**Last Updated**: October 21, 2026
+**Version**: 1.0
+**Status**: Ready for submission after completing TODO items
diff --git a/services/mcp_service/macro-plugin-v1.0.0.zip b/services/mcp_service/macro-plugin-v1.0.0.zip
new file mode 100644
index 0000000000..a14297b160
Binary files /dev/null and b/services/mcp_service/macro-plugin-v1.0.0.zip differ
diff --git a/services/mcp_service/openai-plugin-package/README.md b/services/mcp_service/openai-plugin-package/README.md
new file mode 100644
index 0000000000..6f57b890bd
--- /dev/null
+++ b/services/mcp_service/openai-plugin-package/README.md
@@ -0,0 +1,129 @@
+# Macro Plugin Package for OpenAI ChatGPT
+
+This directory contains the plugin package for submitting Macro's MCP server to the OpenAI ChatGPT Apps Directory.
+
+## Package Structure
+
+```
+openai-plugin-package/
+├── plugin.json # Portable Agent Plugins manifest
+├── mcp.json # MCP server configuration
+├── assets/ # Icon assets
+│ ├── icon.svg # SVG icon (any size)
+│ ├── icon-512.png # 512x512px PNG icon
+│ ├── icon-256.png # 256x256px PNG icon
+│ └── icon-128.png # 128x128px PNG icon
+├── README.md # This file
+└── build-package.sh # Script to build the submission ZIP
+```
+
+## Building the Submission ZIP
+
+Run the build script to create the submission ZIP:
+
+```bash
+cd /workspace/services/mcp_service/openai-plugin-package
+./build-package.sh
+```
+
+This creates `macro-plugin-v1.0.0.zip` in the parent directory, ready for upload to the OpenAI submission portal.
+
+## Configuration Values
+
+### Plugin Metadata
+- **Name**: macro
+- **Display Name**: Macro
+- **Version**: 1.0.0
+- **Category**: productivity
+- **Developer**: Macro (must be set in OpenAI portal)
+
+### URLs
+- **Website**: https://macro.com
+- **Support**: https://docs.macro.com/support
+- **Privacy Policy**: https://macro.com/privacy
+- **Terms of Service**: https://macro.com/terms
+
+### MCP Server
+- **URL**: https://mcp-server.macro.com/mcp
+- **Transport**: Streamable HTTP (SSE)
+- **Authentication**: OAuth 2.1 (configured in portal, not in package)
+
+## Domain Verification
+
+The MCP server must serve the OpenAI domain verification token at:
+```
+https://mcp-server.macro.com/.well-known/openai-apps-challenge
+```
+
+**Setting the token:**
+1. Obtain the challenge token from the OpenAI submission portal
+2. Set it in the appropriate environment configuration:
+ - **Development**: Set `OPENAI_DOMAIN_VERIFICATION_TOKEN` in Doppler for the `mcp-server` project, `dev` config
+ - **Production**: Set `OPENAI_DOMAIN_VERIFICATION_TOKEN` in Doppler for the `mcp-server` project, `prod` config
+3. Redeploy the service (ECS service will pick up the new env var automatically)
+4. Verify the token is accessible: `curl https://mcp-server.macro.com/.well-known/openai-apps-challenge`
+
+**Deployment Flow:**
+1. Token obtained from OpenAI portal →
+2. Set in Doppler for mcp-server service →
+3. Doppler injects env var into ECS task →
+4. `src/main.rs` `openai_domain_verification()` handler returns the token →
+5. OpenAI portal verifies domain ownership
+
+## OAuth Configuration
+
+OAuth is configured in the OpenAI submission portal, not in this package:
+- **Client Secret**: Entered directly in the portal (not in mcp.json)
+- **Authorization Endpoint**: `https://auth.macro.com/oauth2/authorize`
+- **Token Endpoint**: `https://auth.macro.com/oauth2/token`
+- **Scopes**: Full workspace access (default OAuth flow)
+
+The MCP server's `mcp_auth_proxy` handles the OAuth flow with FusionAuth.
+
+## Assets
+
+Icon assets are required in multiple sizes:
+- **SVG**: Vector icon (any size, scalable)
+- **512x512px**: High-resolution PNG
+- **256x256px**: Medium-resolution PNG
+- **128x128px**: Low-resolution PNG
+
+Source assets are in `/workspace/apps/web/public/macro-favicon.svg`.
+
+**TODO**: Export the favicon to PNG in required sizes and place in `assets/` directory.
+
+## Submission Checklist
+
+Before submitting the plugin ZIP to OpenAI:
+
+- [ ] **Icon Assets**: Export and add icon-512.png, icon-256.png, icon-128.png to assets/
+- [ ] **Build ZIP**: Run `./build-package.sh` to create the submission ZIP
+- [ ] **Organization Verification**: Complete business verification in OpenAI Platform Dashboard
+- [ ] **Developer Name**: Set "Macro" as the developer name in the portal
+- [ ] **Domain Verification Token**: Obtain token from portal and set in Doppler
+- [ ] **Deploy with Token**: Redeploy mcp_service to prod with the verification token
+- [ ] **Verify Domain**: Confirm token is accessible at /.well-known/openai-apps-challenge
+- [ ] **OAuth Secret**: Enter FusionAuth client secret in the portal
+- [ ] **Test Credentials**: Create demo account with sample data (no MFA)
+- [ ] **Upload ZIP**: Upload macro-plugin-v1.0.0.zip to OpenAI portal
+- [ ] **Portal Scan**: Run "Scan Tools" in the portal to validate
+- [ ] **Submit for Review**: Complete all portal fields and submit
+
+## Testing Locally
+
+To test the plugin package locally before submission:
+
+1. Install it in ChatGPT Desktop or Codex CLI
+2. Complete the OAuth flow when prompted
+3. Test example prompts:
+ - "Search my workspace for documents about Q4 planning"
+ - "Create a new document called 'Meeting Notes'"
+ - "What are the latest messages in the #engineering channel?"
+ - "Show me upcoming calendar events"
+
+## Support
+
+For questions about the plugin submission:
+- **Technical Lead**: Eric Hayes ([email protected], GitHub: ehayes2000)
+- **Company Support**: [email protected]
+- **Documentation**: https://docs.macro.com/AI/mcp/overview
diff --git a/services/mcp_service/openai-plugin-package/assets/ICONS_TODO.md b/services/mcp_service/openai-plugin-package/assets/ICONS_TODO.md
new file mode 100644
index 0000000000..4ed77dfec5
--- /dev/null
+++ b/services/mcp_service/openai-plugin-package/assets/ICONS_TODO.md
@@ -0,0 +1,36 @@
+# Icon Assets TODO
+
+Export the following PNG icons from `/workspace/apps/web/public/macro-favicon.svg`:
+
+1. **icon-512.png**: 512x512px PNG
+2. **icon-256.png**: 256x256px PNG
+3. **icon-128.png**: 128x128px PNG
+
+## Using ImageMagick or similar
+
+```bash
+# From the repository root
+cd /workspace/apps/web/public
+
+# Convert SVG to PNGs at required sizes
+convert -background none -density 1024 macro-favicon.svg -resize 512x512 \
+ /workspace/services/mcp_service/openai-plugin-package/assets/icon-512.png
+
+convert -background none -density 512 macro-favicon.svg -resize 256x256 \
+ /workspace/services/mcp_service/openai-plugin-package/assets/icon-256.png
+
+convert -background none -density 256 macro-favicon.svg -resize 128x128 \
+ /workspace/services/mcp_service/openai-plugin-package/assets/icon-128.png
+```
+
+## Using Inkscape
+
+```bash
+inkscape macro-favicon.svg --export-filename=icon-512.png --export-width=512 --export-height=512
+inkscape macro-favicon.svg --export-filename=icon-256.png --export-width=256 --export-height=256
+inkscape macro-favicon.svg --export-filename=icon-128.png --export-width=128 --export-height=128
+```
+
+## Or use any design tool
+
+Open the SVG in Figma, Sketch, or Adobe Illustrator and export at the required sizes with transparent backgrounds.
diff --git a/services/mcp_service/openai-plugin-package/assets/icon.svg b/services/mcp_service/openai-plugin-package/assets/icon.svg
new file mode 100644
index 0000000000..1f4ed7bc88
--- /dev/null
+++ b/services/mcp_service/openai-plugin-package/assets/icon.svg
@@ -0,0 +1,5 @@
+<svg width="100%" height="100%" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path d="M0 10.014v6.801a.75.75 0 0 0 .225.513l2.742 2.644 2.002-.8v-7.099l-2.97-2.859z"/>
+ <path d="M4.078 4.8v5.786l1.36 1.309v1.313L12.481 20l2.002-.8-.001-7.1L6.078 4z"/>
+ <path d="M13.594 4.8v5.786l1.36 1.311-.013 1.3L22 20 24 19.2V12.42a.75.75 0 0 0-.225-.533L15.595 4z"/>
+</svg>
diff --git a/services/mcp_service/openai-plugin-package/build-package.sh b/services/mcp_service/openai-plugin-package/build-package.sh
new file mode 100755
index 0000000000..9ceefc603c
--- /dev/null
+++ b/services/mcp_service/openai-plugin-package/build-package.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+set -euo pipefail
+
+# Build script for OpenAI ChatGPT plugin package
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+PACKAGE_DIR="$SCRIPT_DIR"
+OUTPUT_DIR="$(dirname "$SCRIPT_DIR")"
+
+VERSION=$(grep -o '"version": *"[^"]*"' "$PACKAGE_DIR/plugin.json" | cut -d'"' -f4)
+OUTPUT_ZIP="$OUTPUT_DIR/macro-plugin-v${VERSION}.zip"
+
+echo "Building Macro plugin package v${VERSION}..."
+echo "Validating package structure..."
+
+required_files=("plugin.json" "mcp.json" "README.md")
+for file in "${required_files[@]}"; do
+ if [[ ! -f "$PACKAGE_DIR/$file" ]]; then
+ echo "ERROR: Required file missing: $file"
+ exit 1
+ fi
+done
+
+echo "Validating JSON files..."
+for json_file in plugin.json mcp.json; do
+ if ! python3 -m json.tool "$PACKAGE_DIR/$json_file" > /dev/null 2>&1; then
+ echo "ERROR: Invalid JSON in $json_file"
+ exit 1
+ fi
+done
+
+if [[ -f "$OUTPUT_ZIP" ]]; then
+ echo "Removing existing ZIP: $(basename "$OUTPUT_ZIP")"
+ rm "$OUTPUT_ZIP"
+fi
+
+echo "Creating ZIP archive..."
+cd "$PACKAGE_DIR"
+zip -r "$OUTPUT_ZIP" plugin.json mcp.json README.md $(find assets -type f 2>/dev/null | tr '\n' ' ' || echo "")
+
+echo ""
+echo "Package created: $(basename "$OUTPUT_ZIP")"
+echo "Size: $(du -h "$OUTPUT_ZIP" | cut -f1)"
+unzip -l "$OUTPUT_ZIP"
+echo ""
+echo "✓ Ready for OpenAI portal submission"
diff --git a/services/mcp_service/openai-plugin-package/mcp.json b/services/mcp_service/openai-plugin-package/mcp.json
new file mode 100644
index 0000000000..a8655bc9f2
--- /dev/null
+++ b/services/mcp_service/openai-plugin-package/mcp.json
@@ -0,0 +1,9 @@
+{
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json",
+ "mcpServers": {
+ "macro": {
+ "type": "streamable-http",
+ "url": "https://mcp-server.macro.com/mcp"
+ }
+ }
+}
diff --git a/services/mcp_service/openai-plugin-package/plugin.json b/services/mcp_service/openai-plugin-package/plugin.json
new file mode 100644
index 0000000000..3c1213e608
--- /dev/null
+++ b/services/mcp_service/openai-plugin-package/plugin.json
@@ -0,0 +1,42 @@
+{
+ "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
+ "name": "macro",
+ "version": "1.0.0",
+ "description": "Search, read, and work with documents, messages, email, tasks, calendars, and other content in your Macro workspace. Connect AI assistants to your company's unified knowledge base.",
+ "author": {
+ "name": "Macro",
+ "email": "[email protected]",
+ "url": "https://macro.com"
+ },
+ "homepage": "https://macro.com",
+ "repository": "https://github.com/macro-inc/macro",
+ "license": "AGPL-3.0",
+ "keywords": [
+ "productivity",
+ "workspace",
+ "documents",
+ "email",
+ "chat",
+ "crm",
+ "calendar",
+ "tasks"
+ ],
+ "extensions": {
+ "com.openai": {
+ "displayName": "Macro",
+ "shortDescription": "Search, read, and create content across documents, emails, and messages in Macro.",
+ "category": "productivity",
+ "developer": "Macro",
+ "website": "https://macro.com",
+ "supportURL": "https://docs.macro.com/support",
+ "privacyPolicyURL": "https://macro.com/privacy",
+ "termsOfServiceURL": "https://macro.com/terms",
+ "icon": {
+ "svg": "./assets/icon.svg",
+ "512": "./assets/icon-512.png",
+ "256": "./assets/icon-256.png",
+ "128": "./assets/icon-128.png"
+ }
+ }
+ }
+}
diff --git a/services/mcp_service/src/config.rs b/services/mcp_service/src/config.rs
index 0d38d280d7..e3317f334d 100644
--- a/services/mcp_service/src/config.rs
+++ b/services/mcp_service/src/config.rs
@@ -26,6 +26,10 @@ maybe_env_vars! {
/// when unset. Loopback `http` redirect URIs are always allowed and do not
/// need to be listed.
pub struct McpAllowedRedirectHosts;
+ /// OpenAI domain verification token for ChatGPT Apps Directory submission.
+ /// Served at /.well-known/openai-apps-challenge. Optional; uses placeholder
+ /// when unset.
+ pub struct OpenaiDomainVerificationToken;
}
/// Hosts trusted to receive an MCP authorization code when
diff --git a/services/mcp_service/src/main.rs b/services/mcp_service/src/main.rs
index 683daadde9..965526d4e4 100644
--- a/services/mcp_service/src/main.rs
+++ b/services/mcp_service/src/main.rs
@@ -26,6 +26,18 @@ use tool_service::AuthenticatedToolService;
const AUTH_PROXY_CLEANUP_INTERVAL: Duration = Duration::from_secs(60);
const EVENT_BROKER_DRAIN_TIMEOUT: Duration = Duration::from_secs(10);
+/// OpenAI domain verification endpoint for ChatGPT Apps Directory submission.
+///
+/// Returns a placeholder token that must be replaced with the actual token
+/// from the OpenAI submission portal. The token should be set via the
+/// `OPENAI_DOMAIN_VERIFICATION_TOKEN` environment variable.
+async fn openai_domain_verification() -> String {
+ use config::OpenaiDomainVerificationToken;
+ OpenaiDomainVerificationToken::new()
+ .and_then(|token| token.value().map(str::to_string))
+ .unwrap_or_else(|| "PLACEHOLDER_TOKEN_REPLACE_WITH_ACTUAL_OPENAI_TOKEN".to_string())
+}
+
#[tokio::main]
#[tracing::instrument(err)]
async fn main() -> anyhow::Result<()> {
@@ -80,7 +92,11 @@ async fn main() -> anyhow::Result<()> {
}
});
- let app = mcp_router(context.auth_proxy, context.jwt_args, mcp_service);
+ // Add OpenAI domain verification endpoint to the router
+ let app = mcp_router(context.auth_proxy, context.jwt_args, mcp_service).route(
+ "/.well-known/openai-apps-challenge",
+ axum::routing::get(openai_domain_verification),
+ );
let port = config.port;
let addr = format!("0.0.0.0:{port}");