mirror of
https://github.com/dnlbauer/cordra-mcp.git
synced 2026-09-10 13:45:30 +00:00
feat: change variable name for base url
This commit is contained in:
@@ -102,7 +102,7 @@ class CordraClient:
|
||||
CordraAuthenticationError: If authentication fails
|
||||
CordraClientError: For other API errors
|
||||
"""
|
||||
url = f"{self.config.cordra_url}/objects/{object_id}"
|
||||
url = f"{self.config.base_url}/objects/{object_id}"
|
||||
params = {"full": "true"}
|
||||
|
||||
try:
|
||||
@@ -143,7 +143,7 @@ class CordraClient:
|
||||
CordraAuthenticationError: If authentication fails
|
||||
CordraClientError: For other API errors
|
||||
"""
|
||||
url = f"{self.config.cordra_url}/search"
|
||||
url = f"{self.config.base_url}/search"
|
||||
params = {"query": query}
|
||||
|
||||
try:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
"""Configuration settings for the MCP Cordra server."""
|
||||
|
||||
|
||||
from pydantic import Field
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
@@ -15,29 +14,20 @@ class CordraConfig(BaseSettings):
|
||||
case_sensitive=False,
|
||||
)
|
||||
|
||||
cordra_url: str = Field(
|
||||
base_url: str = Field(
|
||||
default="https://localhost:8443",
|
||||
description="Base URL of the Cordra repository"
|
||||
description="Base URL of the Cordra repository",
|
||||
)
|
||||
username: str | None = Field(
|
||||
default=None,
|
||||
description="Username for Cordra authentication"
|
||||
default=None, description="Username for Cordra authentication"
|
||||
)
|
||||
password: str | None = Field(
|
||||
default=None,
|
||||
description="Password for Cordra authentication"
|
||||
default=None, description="Password for Cordra authentication"
|
||||
)
|
||||
max_search_results: int = Field(
|
||||
default=1000,
|
||||
description="Maximum number of search results to return"
|
||||
default=1000, description="Maximum number of search results to return"
|
||||
)
|
||||
verify_ssl: bool = Field(
|
||||
default=True,
|
||||
description="Whether to verify SSL certificates"
|
||||
default=True, description="Whether to verify SSL certificates"
|
||||
)
|
||||
timeout: int = Field(
|
||||
default=30,
|
||||
description="Request timeout in seconds"
|
||||
)
|
||||
|
||||
|
||||
timeout: int = Field(default=30, description="Request timeout in seconds")
|
||||
|
||||
@@ -17,7 +17,7 @@ from cordra_mcp.config import CordraConfig
|
||||
def config():
|
||||
"""Create a test configuration."""
|
||||
return CordraConfig(
|
||||
cordra_url="https://test.example.com",
|
||||
base_url="https://test.example.com",
|
||||
username="testuser",
|
||||
password="testpass",
|
||||
verify_ssl=False,
|
||||
@@ -239,7 +239,7 @@ class TestCordraConfig:
|
||||
def test_default_config(self):
|
||||
"""Test default configuration values."""
|
||||
config = CordraConfig()
|
||||
assert config.cordra_url == "https://localhost:8443"
|
||||
assert config.base_url == "https://localhost:8443"
|
||||
assert config.username is None
|
||||
assert config.password is None
|
||||
assert config.max_search_results == 1000
|
||||
|
||||
Reference in New Issue
Block a user