airbyte-internal-ops 0.5.1__py3-none-any.whl → 0.6.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,84 +0,0 @@
1
- # Copyright (c) 2025 Airbyte, Inc., all rights reserved.
2
- """MCP resources for the Airbyte Admin MCP server.
3
-
4
- This module provides read-only resources that can be accessed by MCP clients.
5
- """
6
-
7
- import importlib.metadata as md
8
- import subprocess
9
- from functools import lru_cache
10
-
11
- from fastmcp import FastMCP
12
-
13
- from airbyte_ops_mcp.constants import MCP_SERVER_NAME
14
- from airbyte_ops_mcp.mcp._mcp_utils import (
15
- mcp_resource,
16
- register_mcp_resources,
17
- )
18
-
19
-
20
- @lru_cache(maxsize=1)
21
- def _get_version_info() -> dict[str, str | list[str] | None]:
22
- """Get version information for the MCP server.
23
-
24
- Returns:
25
- Dictionary with version information including package version,
26
- git SHA, and FastMCP version
27
- """
28
- package_name = "airbyte-internal-ops"
29
-
30
- try:
31
- version = md.version(package_name)
32
- except md.PackageNotFoundError:
33
- version = "0.1.0+dev"
34
-
35
- try:
36
- fastmcp_version = md.version("fastmcp")
37
- except md.PackageNotFoundError:
38
- fastmcp_version = None
39
-
40
- try:
41
- git_sha = subprocess.run(
42
- ["git", "rev-parse", "--short", "HEAD"],
43
- capture_output=True,
44
- text=True,
45
- check=True,
46
- timeout=5,
47
- ).stdout.strip()
48
- except Exception:
49
- git_sha = None
50
-
51
- return {
52
- "name": package_name,
53
- "docs_url": "https://github.com/airbytehq/airbyte-ops-mcp",
54
- "release_history_url": "https://github.com/airbytehq/airbyte-ops-mcp/releases",
55
- "version": version,
56
- "git_sha": git_sha,
57
- "fastmcp_version": fastmcp_version,
58
- "domains": ["registry", "metadata", "qa", "insights", "repo"],
59
- }
60
-
61
-
62
- @mcp_resource(
63
- uri=f"{MCP_SERVER_NAME}://server/info",
64
- description="Server information for the Airbyte Admin MCP server",
65
- mime_type="application/json",
66
- )
67
- def mcp_server_info() -> dict[str, str | list[str] | None]:
68
- """Resource that returns information for the MCP server.
69
-
70
- This includes package version, release history, help URLs, as well as other information.
71
-
72
- Returns:
73
- Dictionary with version information
74
- """
75
- return _get_version_info()
76
-
77
-
78
- def register_server_info_resources(app: FastMCP) -> None:
79
- """Register server info resources with the FastMCP app.
80
-
81
- Args:
82
- app: FastMCP application instance
83
- """
84
- register_mcp_resources(app, domain=__name__)