We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/cabout-me/gramps-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
# gramps-mcp - AI-Powered Genealogy Research & Management
# Copyright (C) 2025 cabout.me
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
Configuration management for Gramps MCP Server.
"""
import os
from dotenv import load_dotenv
from pydantic import BaseModel, Field, HttpUrl, ValidationError
# Load environment variables from .env file
load_dotenv()
class Settings(BaseModel):
"""Application settings loaded from environment variables."""
# Gramps Web API Configuration
gramps_api_url: HttpUrl = Field(..., description="Base URL for Gramps Web API")
gramps_username: str = Field(..., description="Username for Gramps Web API")
gramps_password: str = Field(..., description="Password for Gramps Web API")
gramps_tree_id: str = Field(..., description="Family tree identifier")
def get_settings() -> Settings:
"""Get settings from environment variables."""
try:
return Settings(
gramps_api_url=HttpUrl(os.environ["GRAMPS_API_URL"]),
gramps_username=os.environ["GRAMPS_USERNAME"],
gramps_password=os.environ["GRAMPS_PASSWORD"],
gramps_tree_id=os.environ["GRAMPS_TREE_ID"],
)
except KeyError as e:
raise ValueError(f"Missing required environment variable: {e}")
except ValidationError as e:
raise ValueError(f"Invalid configuration: {e}")