Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions src/openapi-mcp-server/mcp/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,18 @@ export class MCPProxy {
}

private parseHeadersFromEnv(): Record<string, string> {
// First try OPENAPI_MCP_HEADERS (existing behavior)

// First try NOTION_TOKEN (recommended approach)
const notionToken = process.env.NOTION_TOKEN
if (notionToken) {
console.log('Using NOTION_TOKEN (recommended)');
return {
'Authorization': `Bearer ${notionToken}`,
'Notion-Version': '2022-06-28'
}
}

// Fallback to OPENAPI_MCP_HEADERS (for advanced use cases)
const headersJson = process.env.OPENAPI_MCP_HEADERS
if (headersJson) {
try {
Expand All @@ -142,15 +153,6 @@ export class MCPProxy {
}
}

// Alternative: try NOTION_TOKEN
const notionToken = process.env.NOTION_TOKEN
if (notionToken) {
return {
'Authorization': `Bearer ${notionToken}`,
'Notion-Version': '2022-06-28'
}
}

return {}
}

Expand Down