gopher-mcp-python 0.1.23__tar.gz → 0.1.34__tar.gz
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.
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/PKG-INFO +13 -2
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/README.md +12 -1
- gopher_mcp_python-0.1.34/gopher_mcp_python/__init__.py +197 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/agent.py +635 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/auth/__init__.py +83 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/config.py +89 -1
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/__init__.py +38 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/auth_client.py +0 -1
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/loader.py +36 -4
- gopher_mcp_python-0.1.34/gopher_mcp_python/ffi/library.py +919 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_authorization_url.py +49 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_browser.py +33 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_discovery.py +341 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_loopback.py +148 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_pkce.py +21 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_registration.py +89 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_resolver.py +362 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_runtime_options.py +29 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_server_targets.py +76 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_token_exchange.py +104 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/oauth_token_store.py +75 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/runtime_options.py +286 -0
- gopher_mcp_python-0.1.34/gopher_mcp_python/server_config.py +112 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python.egg-info/PKG-INFO +13 -2
- gopher_mcp_python-0.1.34/gopher_mcp_python.egg-info/SOURCES.txt +70 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/pyproject.toml +1 -1
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/setup.py +1 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/tests/test_agent_create_by.py +33 -14
- gopher_mcp_python-0.1.34/tests/test_agent_create_with_oauth.py +376 -0
- gopher_mcp_python-0.1.34/tests/test_agent_error_message.py +130 -0
- gopher_mcp_python-0.1.34/tests/test_agent_lifecycle.py +77 -0
- gopher_mcp_python-0.1.34/tests/test_agent_runtime_options.py +227 -0
- gopher_mcp_python-0.1.34/tests/test_auth_exports.py +91 -0
- gopher_mcp_python-0.1.34/tests/test_config.py +281 -0
- gopher_mcp_python-0.1.34/tests/test_dump_version.py +28 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/tests/test_ffi.py +175 -0
- gopher_mcp_python-0.1.34/tests/test_ffi_runtime_options.py +145 -0
- gopher_mcp_python-0.1.34/tests/test_header_create_by_url_example.py +54 -0
- gopher_mcp_python-0.1.34/tests/test_library_search_paths.py +114 -0
- gopher_mcp_python-0.1.34/tests/test_linux_native_packaging.py +196 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_authorization_url.py +112 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_browser.py +53 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_create_with_url_integration.py +210 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_discovery.py +240 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_loopback.py +80 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_pkce.py +23 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_registration.py +56 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_resolver.py +136 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_runtime_options.py +48 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_server_targets.py +58 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_token_exchange.py +91 -0
- gopher_mcp_python-0.1.34/tests/test_oauth_token_store.py +74 -0
- gopher_mcp_python-0.1.34/tests/test_server_config.py +74 -0
- gopher_mcp_python-0.1.23/gopher_mcp_python/__init__.py +0 -84
- gopher_mcp_python-0.1.23/gopher_mcp_python/agent.py +0 -423
- gopher_mcp_python-0.1.23/gopher_mcp_python/auth/__init__.py +0 -31
- gopher_mcp_python-0.1.23/gopher_mcp_python/ffi/library.py +0 -517
- gopher_mcp_python-0.1.23/gopher_mcp_python/server_config.py +0 -47
- gopher_mcp_python-0.1.23/gopher_mcp_python.egg-info/SOURCES.txt +0 -35
- gopher_mcp_python-0.1.23/tests/test_config.py +0 -79
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/LICENSE +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/auth/errors.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/auth/gopher_auth.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/auth/scope_helpers.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/errors.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/__init__.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/auto_refresh.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/config_loader.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/oauth_client.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/session_manager.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/types.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/ffi/auth/validation_options.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python/result.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python.egg-info/dependency_links.txt +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python.egg-info/requires.txt +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/gopher_mcp_python.egg-info/top_level.txt +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/setup.cfg +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/tests/test_gopher_auth.py +0 -0
- {gopher_mcp_python-0.1.23 → gopher_mcp_python-0.1.34}/tests/test_result.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gopher-mcp-python
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.34
|
|
4
4
|
Summary: Python SDK for Gopher MCP - AI Agent orchestration framework with native performance
|
|
5
5
|
Author-email: Gopher Security <dev@gophersecurity.com>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -59,7 +59,18 @@ Python SDK for gopher-mcp-python, providing AI agent orchestration with native C
|
|
|
59
59
|
## Requirements
|
|
60
60
|
|
|
61
61
|
- Python 3.8 or higher
|
|
62
|
+
- `venv` and `pip` for PyPI installation, examples, and development workflows
|
|
62
63
|
- Native gopher-mcp-python library (built from source)
|
|
64
|
+
- On Linux, system OpenSSL runtime libraries (`libssl` / `libcrypto`) from
|
|
65
|
+
your distribution. Native wheels do not bundle OpenSSL, so OS security
|
|
66
|
+
updates remain effective.
|
|
67
|
+
|
|
68
|
+
On Debian/Ubuntu, install the Python venv and pip packages before using the
|
|
69
|
+
PyPI install path, running examples, or setting up development dependencies:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
sudo apt-get install python3 python3-venv python3-pip
|
|
73
|
+
```
|
|
63
74
|
|
|
64
75
|
## Installation
|
|
65
76
|
|
|
@@ -78,7 +89,7 @@ cd gopher-mcp-python
|
|
|
78
89
|
|
|
79
90
|
3. Install the Python package:
|
|
80
91
|
```bash
|
|
81
|
-
pip install -e .
|
|
92
|
+
python3 -m pip install -e .
|
|
82
93
|
```
|
|
83
94
|
|
|
84
95
|
## Quick Start
|
|
@@ -15,7 +15,18 @@ Python SDK for gopher-mcp-python, providing AI agent orchestration with native C
|
|
|
15
15
|
## Requirements
|
|
16
16
|
|
|
17
17
|
- Python 3.8 or higher
|
|
18
|
+
- `venv` and `pip` for PyPI installation, examples, and development workflows
|
|
18
19
|
- Native gopher-mcp-python library (built from source)
|
|
20
|
+
- On Linux, system OpenSSL runtime libraries (`libssl` / `libcrypto`) from
|
|
21
|
+
your distribution. Native wheels do not bundle OpenSSL, so OS security
|
|
22
|
+
updates remain effective.
|
|
23
|
+
|
|
24
|
+
On Debian/Ubuntu, install the Python venv and pip packages before using the
|
|
25
|
+
PyPI install path, running examples, or setting up development dependencies:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
sudo apt-get install python3 python3-venv python3-pip
|
|
29
|
+
```
|
|
19
30
|
|
|
20
31
|
## Installation
|
|
21
32
|
|
|
@@ -34,7 +45,7 @@ cd gopher-mcp-python
|
|
|
34
45
|
|
|
35
46
|
3. Install the Python package:
|
|
36
47
|
```bash
|
|
37
|
-
pip install -e .
|
|
48
|
+
python3 -m pip install -e .
|
|
38
49
|
```
|
|
39
50
|
|
|
40
51
|
## Quick Start
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Gopher Orch Python SDK - AI Agent orchestration framework with native performance.
|
|
3
|
+
|
|
4
|
+
This module provides Python bindings to the gopher-mcp-python native library through ctypes FFI.
|
|
5
|
+
|
|
6
|
+
Example:
|
|
7
|
+
>>> from gopher_mcp_python import GopherAgent, GopherAgentConfig
|
|
8
|
+
>>>
|
|
9
|
+
>>> # Create an agent with API key
|
|
10
|
+
>>> config = (GopherAgentConfig.builder()
|
|
11
|
+
... .provider("AnthropicProvider")
|
|
12
|
+
... .model("claude-3-haiku-20240307")
|
|
13
|
+
... .api_key("your-api-key")
|
|
14
|
+
... .build())
|
|
15
|
+
>>> agent = GopherAgent.create(config)
|
|
16
|
+
>>>
|
|
17
|
+
>>> # Run a query
|
|
18
|
+
>>> answer = agent.run("What time is it in Tokyo?")
|
|
19
|
+
>>> print(answer)
|
|
20
|
+
>>>
|
|
21
|
+
>>> # Cleanup
|
|
22
|
+
>>> agent.dispose()
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
from importlib import import_module
|
|
26
|
+
|
|
27
|
+
from gopher_mcp_python.agent import GopherAgent
|
|
28
|
+
from gopher_mcp_python.config import (
|
|
29
|
+
GopherAgentConfig,
|
|
30
|
+
GopherAgentConfigBuilder,
|
|
31
|
+
)
|
|
32
|
+
from gopher_mcp_python.runtime_options import (
|
|
33
|
+
GopherAgentCreateOptions,
|
|
34
|
+
GopherAgentOAuthOptions,
|
|
35
|
+
GopherAgentRuntimeOptions,
|
|
36
|
+
GopherAgentTokenRecord,
|
|
37
|
+
GopherAgentTokenStore,
|
|
38
|
+
)
|
|
39
|
+
from gopher_mcp_python.result import AgentResult, AgentResultStatus, AgentResultBuilder
|
|
40
|
+
from gopher_mcp_python.errors import (
|
|
41
|
+
AgentError,
|
|
42
|
+
ApiKeyError,
|
|
43
|
+
ConnectionError,
|
|
44
|
+
TimeoutError,
|
|
45
|
+
)
|
|
46
|
+
from gopher_mcp_python.server_config import ServerConfig, ServerConfigRoute
|
|
47
|
+
from gopher_mcp_python.ffi import GopherOrchLibrary, GopherOrchHandle
|
|
48
|
+
|
|
49
|
+
__version__ = "0.1.34"
|
|
50
|
+
|
|
51
|
+
_AUTH_EXPORTS = {
|
|
52
|
+
"GopherAuth",
|
|
53
|
+
"GopherAuthError",
|
|
54
|
+
"ConfigurationError",
|
|
55
|
+
"InsufficientScopesError",
|
|
56
|
+
"JwksError",
|
|
57
|
+
"TokenExchangeError",
|
|
58
|
+
"TokenValidationError",
|
|
59
|
+
"has_all_scopes",
|
|
60
|
+
"has_any_scope",
|
|
61
|
+
"has_scope",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
_AUTH_FFI_EXPORTS = {
|
|
65
|
+
"AutoRefreshResult",
|
|
66
|
+
"RegistrationResponse",
|
|
67
|
+
"TokenResponse",
|
|
68
|
+
"ValidationResult",
|
|
69
|
+
"TokenPayload",
|
|
70
|
+
"GopherAuthContext",
|
|
71
|
+
"ERROR_DESCRIPTIONS",
|
|
72
|
+
"get_error_description",
|
|
73
|
+
"gopher_create_empty_auth_context",
|
|
74
|
+
"is_gopher_auth_error",
|
|
75
|
+
"GopherAuthClient",
|
|
76
|
+
"GopherAuthConfig",
|
|
77
|
+
"GopherOAuthClient",
|
|
78
|
+
"GopherSessionManager",
|
|
79
|
+
"GopherValidationOptions",
|
|
80
|
+
"gopher_auth_auto_refresh",
|
|
81
|
+
"gopher_auth_build_oidc_discovery_metadata",
|
|
82
|
+
"gopher_auth_build_oauth_server_metadata",
|
|
83
|
+
"gopher_auth_build_protected_resource_metadata",
|
|
84
|
+
"gopher_auth_extract_bearer_token",
|
|
85
|
+
"gopher_auth_extract_method",
|
|
86
|
+
"gopher_auth_extract_path",
|
|
87
|
+
"gopher_auth_url_decode",
|
|
88
|
+
"gopher_auth_url_encode",
|
|
89
|
+
"gopher_auth_validate_all_scopes",
|
|
90
|
+
"gopher_auth_validate_any_scopes",
|
|
91
|
+
"gopher_auth_validate_idp",
|
|
92
|
+
"gopher_create_validation_options",
|
|
93
|
+
"gopher_generate_www_authenticate_header",
|
|
94
|
+
"gopher_generate_www_authenticate_header_v2",
|
|
95
|
+
"gopher_get_auth_library_version",
|
|
96
|
+
"gopher_init_auth_library",
|
|
97
|
+
"gopher_is_auth_library_initialized",
|
|
98
|
+
"gopher_shutdown_auth_library",
|
|
99
|
+
"is_auth_available",
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def __getattr__(name: str):
|
|
104
|
+
if name in _AUTH_EXPORTS:
|
|
105
|
+
auth = import_module("gopher_mcp_python.auth")
|
|
106
|
+
value = getattr(auth, name)
|
|
107
|
+
globals()[name] = value
|
|
108
|
+
return value
|
|
109
|
+
|
|
110
|
+
if name == "GopherAuthFfiError":
|
|
111
|
+
from gopher_mcp_python.ffi.auth import GopherAuthError as GopherAuthFfiError
|
|
112
|
+
|
|
113
|
+
globals()[name] = GopherAuthFfiError
|
|
114
|
+
return GopherAuthFfiError
|
|
115
|
+
|
|
116
|
+
if name in _AUTH_FFI_EXPORTS:
|
|
117
|
+
ffi_auth = import_module("gopher_mcp_python.ffi.auth")
|
|
118
|
+
value = getattr(ffi_auth, name)
|
|
119
|
+
globals()[name] = value
|
|
120
|
+
return value
|
|
121
|
+
|
|
122
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
__all__ = [
|
|
126
|
+
# Main classes
|
|
127
|
+
"GopherAgent",
|
|
128
|
+
"GopherAgentConfig",
|
|
129
|
+
"GopherAgentConfigBuilder",
|
|
130
|
+
"GopherAgentCreateOptions",
|
|
131
|
+
"GopherAgentOAuthOptions",
|
|
132
|
+
"GopherAgentRuntimeOptions",
|
|
133
|
+
"GopherAgentTokenRecord",
|
|
134
|
+
"GopherAgentTokenStore",
|
|
135
|
+
"AgentResult",
|
|
136
|
+
"AgentResultStatus",
|
|
137
|
+
"AgentResultBuilder",
|
|
138
|
+
"ServerConfig",
|
|
139
|
+
"ServerConfigRoute",
|
|
140
|
+
# Errors
|
|
141
|
+
"AgentError",
|
|
142
|
+
"ApiKeyError",
|
|
143
|
+
"ConnectionError",
|
|
144
|
+
"TimeoutError",
|
|
145
|
+
# FFI
|
|
146
|
+
"GopherOrchLibrary",
|
|
147
|
+
"GopherOrchHandle",
|
|
148
|
+
# Auth
|
|
149
|
+
"GopherAuth",
|
|
150
|
+
"GopherAuthError",
|
|
151
|
+
"GopherAuthFfiError",
|
|
152
|
+
"AutoRefreshResult",
|
|
153
|
+
"RegistrationResponse",
|
|
154
|
+
"TokenResponse",
|
|
155
|
+
"ValidationResult",
|
|
156
|
+
"TokenPayload",
|
|
157
|
+
"GopherAuthContext",
|
|
158
|
+
"ERROR_DESCRIPTIONS",
|
|
159
|
+
"get_error_description",
|
|
160
|
+
"gopher_create_empty_auth_context",
|
|
161
|
+
"is_gopher_auth_error",
|
|
162
|
+
"GopherAuthClient",
|
|
163
|
+
"GopherAuthConfig",
|
|
164
|
+
"GopherOAuthClient",
|
|
165
|
+
"GopherSessionManager",
|
|
166
|
+
"GopherValidationOptions",
|
|
167
|
+
"gopher_auth_auto_refresh",
|
|
168
|
+
"gopher_auth_build_oidc_discovery_metadata",
|
|
169
|
+
"gopher_auth_build_oauth_server_metadata",
|
|
170
|
+
"gopher_auth_build_protected_resource_metadata",
|
|
171
|
+
"gopher_auth_extract_bearer_token",
|
|
172
|
+
"gopher_auth_extract_method",
|
|
173
|
+
"gopher_auth_extract_path",
|
|
174
|
+
"gopher_auth_url_decode",
|
|
175
|
+
"gopher_auth_url_encode",
|
|
176
|
+
"gopher_auth_validate_all_scopes",
|
|
177
|
+
"gopher_auth_validate_any_scopes",
|
|
178
|
+
"gopher_auth_validate_idp",
|
|
179
|
+
"gopher_create_validation_options",
|
|
180
|
+
"gopher_generate_www_authenticate_header",
|
|
181
|
+
"gopher_generate_www_authenticate_header_v2",
|
|
182
|
+
"gopher_get_auth_library_version",
|
|
183
|
+
"gopher_init_auth_library",
|
|
184
|
+
"gopher_is_auth_library_initialized",
|
|
185
|
+
"gopher_shutdown_auth_library",
|
|
186
|
+
"is_auth_available",
|
|
187
|
+
"ConfigurationError",
|
|
188
|
+
"InsufficientScopesError",
|
|
189
|
+
"JwksError",
|
|
190
|
+
"TokenExchangeError",
|
|
191
|
+
"TokenValidationError",
|
|
192
|
+
"has_all_scopes",
|
|
193
|
+
"has_any_scope",
|
|
194
|
+
"has_scope",
|
|
195
|
+
# Version
|
|
196
|
+
"__version__",
|
|
197
|
+
]
|