Skip to main content
Glama

Notion API MCP Server

test_auth_init.py1.05 kB
"""Test authentication utility functions.""" import pytest from notion_api_mcp.utils.auth import ( load_env_file, get_auth_headers, validate_config ) def test_get_auth_headers(): """Test auth header generation.""" headers = get_auth_headers("test_token") assert headers["Authorization"] == "Bearer test_token" assert headers["Notion-Version"] assert headers["Content-Type"] == "application/json" def test_validate_config(monkeypatch): """Test configuration validation.""" # Valid config monkeypatch.setenv("NOTION_API_KEY", "test_key") monkeypatch.setenv("NOTION_DATABASE_ID", "test_db") validate_config() # Should not raise # Missing API key monkeypatch.delenv("NOTION_API_KEY") with pytest.raises(ValueError, match="NOTION_API_KEY"): validate_config() # Missing database ID monkeypatch.setenv("NOTION_API_KEY", "test_key") monkeypatch.delenv("NOTION_DATABASE_ID") with pytest.raises(ValueError, match="NOTION_DATABASE_ID"): validate_config()

MCP directory API

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

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pbohannon/notion-api-mcp'

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