gibson-cli 0.8.2__tar.gz → 0.8.4__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.
- {gibson_cli-0.8.2/gibson_cli.egg-info → gibson_cli-0.8.4}/PKG-INFO +1 -1
- gibson_cli-0.8.4/bin/release.sh +5 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/api/BaseApi.py +1 -5
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/api/ProjectApi.py +0 -1
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/bin/gibson.py +1 -4
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/auth/Logout.py +2 -2
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/mcp/McpServer.py +1 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/CommandRouter.py +4 -1
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Configuration.py +11 -4
- gibson_cli-0.8.4/gibson/services/mcp/server.py +182 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4/gibson_cli.egg-info}/PKG-INFO +1 -1
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/pyproject.toml +1 -1
- gibson_cli-0.8.2/bin/release.sh +0 -5
- gibson_cli-0.8.2/gibson/services/mcp/server.py +0 -136
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/.gitignore +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/.pre-commit-config.yaml +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/README.md +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/bin/build.sh +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/bin/clean.sh +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/api/Cli.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/api/DataApi.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/BaseCommand.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Build.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Conf.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Count.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Dev.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Forget.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Help.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Merge.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Modify.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Question.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Remove.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Show.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Tree.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/Version.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/auth/Auth.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/auth/Login.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Api.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Base.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Code.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Model.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Models.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Schema.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Schemas.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Test.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/code/Tests.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/importer/Import.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/importer/OpenApi.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/list/Entities.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/list/List.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/list/Projects.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/new/Module.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/new/New.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/new/Project.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/rename/Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/rename/Rename.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/rewrite/Rewrite.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/tests/test_command_BaseCommand.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/command/tests/test_command_Conf.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Api.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Code.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Custom.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Datastore.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Dependencies.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Dev.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Frameworks.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Modeler.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Paths.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Platform.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Project.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/Version.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/dev/Api.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/dev/Base.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/dev/Model.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/dev/Schema.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/tests/test_conf_Dependencies.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/conf/tests/test_conf_Platform.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Colors.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Completions.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Conversation.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Diff.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Env.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Memory.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/PythonPath.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/Spinner.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/TimeKeeper.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/core/utils.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/data/bash-completion.tmpl +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/data/mysql/default-ref-table.tmpl +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/data/mysql/default-table.tmpl +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/data/postgresql/default-ref-table.tmpl +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/data/postgresql/default-table.tmpl +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/db/TableExceptions.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/db/tests/test_db_TableExceptions.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/dev/Dev.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/display/Header.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/display/WorkspaceFooter.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/display/WorkspaceHeader.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/display/tests/test_display_Header.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/display/tests/test_display_WorkspaceFooter.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/display/tests/test_display_WorkspaceHeader.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/lang/Python.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/lang/tests/test_lang_Python.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/auth/Server.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/context/schema/DataDictionary.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/context/schema/EntityKeys.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/context/schema/Manager.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/Authenticator.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/BaseCustomization.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/CustomizationManager.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/Index.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/tests/test_code_customization_Authenticator.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/constraints/ReferenceConstraint.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/keys/ForeignKey.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/keys/Index.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/keys/IndexAttribute.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_ForeignKey.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_Index.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_IndexAttribute.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/testing.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/tests/test_structure_mysql_Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/postgresql/Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/postgresql/References.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/postgresql/table/ForeignKey.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/postgresql/table/tests/test_structure_postgresql_table_ForeignKey.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/postgresql/testing.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/postgresql/tests/test_structure_postgresql_Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/tests/test_structure_Entity.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/tests/test_Env.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/tests/test_Memory.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/tests/test_utils.py +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson_cli.egg-info/SOURCES.txt +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson_cli.egg-info/dependency_links.txt +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson_cli.egg-info/entry_points.txt +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson_cli.egg-info/requires.txt +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson_cli.egg-info/top_level.txt +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/requirements.txt +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/setup.cfg +0 -0
- {gibson_cli-0.8.2 → gibson_cli-0.8.4}/venv/bin/activate_this.py +0 -0
@@ -2,7 +2,6 @@ import pprint
|
|
2
2
|
|
3
3
|
import requests
|
4
4
|
|
5
|
-
import gibson.core.Colors as Colors
|
6
5
|
from gibson.core.Configuration import Configuration
|
7
6
|
|
8
7
|
|
@@ -103,10 +102,7 @@ class BaseApi:
|
|
103
102
|
|
104
103
|
def __raise_for_status(self, r):
|
105
104
|
if r.status_code == 401:
|
106
|
-
self.configuration.
|
107
|
-
f"\nYou need to log in to continue. Please run {Colors.command(self.configuration.command, 'auth', args='login')} and then try again.\n"
|
108
|
-
)
|
109
|
-
exit(1)
|
105
|
+
self.configuration.login_required()
|
110
106
|
|
111
107
|
try:
|
112
108
|
r.raise_for_status()
|
@@ -12,10 +12,7 @@ def main():
|
|
12
12
|
print(f"{Header().render('dev mode')}\n")
|
13
13
|
try:
|
14
14
|
configuration = Configuration()
|
15
|
-
|
16
|
-
configuration.initialize()
|
17
|
-
else:
|
18
|
-
CommandRouter(configuration).run()
|
15
|
+
CommandRouter(configuration).run()
|
19
16
|
except KeyboardInterrupt:
|
20
17
|
exit(1)
|
21
18
|
|
@@ -3,6 +3,6 @@ from gibson.command.BaseCommand import BaseCommand
|
|
3
3
|
|
4
4
|
class Logout(BaseCommand):
|
5
5
|
def execute(self):
|
6
|
-
self.configuration.
|
7
|
-
self.conversation.type(
|
6
|
+
self.configuration.set_auth_tokens(None, None)
|
7
|
+
self.conversation.type("You are now logged out.")
|
8
8
|
self.conversation.newline()
|
@@ -12,6 +12,7 @@ class McpServer(BaseCommand):
|
|
12
12
|
# Setup signal handlers to exit the server
|
13
13
|
signal.signal(signal.SIGTERM, lambda signo, frame: sys.exit(0))
|
14
14
|
signal.signal(signal.SIGINT, lambda signo, frame: sys.exit(0))
|
15
|
+
self.conversation.type("GibsonAI MCP server running...\n")
|
15
16
|
mcp.run()
|
16
17
|
else:
|
17
18
|
self.usage()
|
@@ -33,7 +33,10 @@ class CommandRouter:
|
|
33
33
|
|
34
34
|
def run(self):
|
35
35
|
if len(sys.argv) == 1:
|
36
|
-
|
36
|
+
if self.configuration.settings is None:
|
37
|
+
self.configuration.initialize()
|
38
|
+
else:
|
39
|
+
Help(self.configuration).execute()
|
37
40
|
return self
|
38
41
|
|
39
42
|
Env().verify(self.configuration)
|
@@ -17,11 +17,12 @@ class Configuration:
|
|
17
17
|
VERSION = 2
|
18
18
|
API_ENV = os.environ.get("GIBSONAI_API_ENV", "production")
|
19
19
|
|
20
|
-
def __init__(self):
|
20
|
+
def __init__(self, interactive=True):
|
21
21
|
self.command = None
|
22
22
|
if len(sys.argv) >= 1:
|
23
23
|
self.command = sys.argv[0].split("/")[-1]
|
24
24
|
|
25
|
+
self.interactive = interactive
|
25
26
|
self.conversation = Conversation()
|
26
27
|
self.platform = Platform()
|
27
28
|
self.project = None
|
@@ -132,7 +133,7 @@ class Configuration:
|
|
132
133
|
os.remove(test_file)
|
133
134
|
|
134
135
|
return path
|
135
|
-
except:
|
136
|
+
except Exception:
|
136
137
|
self.conversation.newline()
|
137
138
|
self.conversation.type(
|
138
139
|
" Well this is embarrassing. I cannot write to that path.\n"
|
@@ -304,6 +305,13 @@ class Configuration:
|
|
304
305
|
self.set_auth_tokens(access_token, refresh_token)
|
305
306
|
return True
|
306
307
|
|
308
|
+
def login_required(self):
|
309
|
+
if self.interactive:
|
310
|
+
self.conversation.message_login_required(self)
|
311
|
+
exit(1)
|
312
|
+
|
313
|
+
return self
|
314
|
+
|
307
315
|
def read_config(self):
|
308
316
|
try:
|
309
317
|
with open(self.paths.config, "r") as f:
|
@@ -317,8 +325,7 @@ class Configuration:
|
|
317
325
|
|
318
326
|
def require_login(self):
|
319
327
|
if self.get_access_token() is None:
|
320
|
-
self.
|
321
|
-
exit(1)
|
328
|
+
self.login_required()
|
322
329
|
|
323
330
|
return self
|
324
331
|
|
@@ -0,0 +1,182 @@
|
|
1
|
+
from typing import Dict, List
|
2
|
+
|
3
|
+
from mcp.server.fastmcp import FastMCP
|
4
|
+
from requests.exceptions import HTTPError
|
5
|
+
|
6
|
+
from gibson.api.DataApi import DataApi
|
7
|
+
from gibson.api.ProjectApi import ProjectApi
|
8
|
+
from gibson.core.Configuration import Configuration
|
9
|
+
|
10
|
+
mcp = FastMCP("GibsonAI")
|
11
|
+
|
12
|
+
# Note: Resources are not yet supported by Cursor, everything must be implemented as a tool
|
13
|
+
# See https://docs.cursor.com/context/model-context-protocol#limitations
|
14
|
+
|
15
|
+
|
16
|
+
def error_handler(e: HTTPError) -> Dict:
|
17
|
+
"""Handle HTTP errors from the API"""
|
18
|
+
status_code = e.response.status_code
|
19
|
+
message = e.response.json()
|
20
|
+
if status_code == 401:
|
21
|
+
message = "Authentication required. Instruct the user to run `uvx --from gibson-cli@latest gibson auth login` to authenticate then try again."
|
22
|
+
return {"status_code": status_code, "error": message}
|
23
|
+
|
24
|
+
|
25
|
+
@mcp.tool()
|
26
|
+
def get_projects() -> List[Dict]:
|
27
|
+
"""
|
28
|
+
Get all of the user's existing GibsonAI projects.
|
29
|
+
<IMPORTANT>
|
30
|
+
If the user mentions a project by name and you don't have the project UUID, call this tool.
|
31
|
+
If there's a .gibsonai file in the project or workspace root directory, assume that the user wants to use that project and don't call this tool unless there's a good reason to do so.
|
32
|
+
</IMPORTANT>
|
33
|
+
"""
|
34
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
35
|
+
try:
|
36
|
+
return project_api.list()
|
37
|
+
except HTTPError as e:
|
38
|
+
return error_handler(e)
|
39
|
+
|
40
|
+
|
41
|
+
@mcp.tool()
|
42
|
+
def create_project() -> Dict:
|
43
|
+
"""
|
44
|
+
Create a new GibsonAI project.
|
45
|
+
<IMPORTANT>
|
46
|
+
Before assuming that the user wants to create a new project, look for a .gibsonai file in the project or workspace root directory.
|
47
|
+
If the .gibsonai file exists and contains a project UUID, call get_project_details to get the project details and ask the user if they want to use the existing project.
|
48
|
+
If the .gibsonai file doesn't exist, but the user mentions a project name, call get_projects to check if a project with a similar name already exists and ask the user if they want to use the existing project.
|
49
|
+
If the user explicitly states they want to create a new project, call this tool without confirming.
|
50
|
+
If you call this tool, ask the user if they want to update the .gibsonai file (or create it if it doesn't exist) with the new project UUID.
|
51
|
+
</IMPORTANT>
|
52
|
+
"""
|
53
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
54
|
+
try:
|
55
|
+
return project_api.create()
|
56
|
+
except HTTPError as e:
|
57
|
+
return error_handler(e)
|
58
|
+
|
59
|
+
|
60
|
+
@mcp.tool()
|
61
|
+
def get_project_details(uuid: str) -> Dict:
|
62
|
+
"""
|
63
|
+
Get a GibsonAI project's details.
|
64
|
+
<IMPORTANT>
|
65
|
+
If there's a .gibsonai file in the project or workspace root directory, assume that the user wants to use that project unless they explicitly state otherwise.
|
66
|
+
</IMPORTANT>
|
67
|
+
"""
|
68
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
69
|
+
try:
|
70
|
+
return project_api.lookup(uuid=uuid)
|
71
|
+
except HTTPError as e:
|
72
|
+
return error_handler(e)
|
73
|
+
|
74
|
+
|
75
|
+
@mcp.tool()
|
76
|
+
def get_project_hosted_api_details(uuid: str) -> str:
|
77
|
+
"""
|
78
|
+
Get a GibsonAI project's hosted API details.
|
79
|
+
<IMPORTANT>
|
80
|
+
This includes necessary context for an LLM to understand and generate code related to fetching or modifying the project's data via the hosted REST API.
|
81
|
+
</IMPORTANT>
|
82
|
+
"""
|
83
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
84
|
+
try:
|
85
|
+
return project_api.mcp(uuid=uuid)
|
86
|
+
except HTTPError as e:
|
87
|
+
return error_handler(e)
|
88
|
+
|
89
|
+
|
90
|
+
@mcp.tool()
|
91
|
+
def update_project(uuid: str, project_name: str) -> Dict:
|
92
|
+
"""
|
93
|
+
Update a GibsonAI project's details.
|
94
|
+
This currently only updates the project's name.
|
95
|
+
Returns the updated project details.
|
96
|
+
"""
|
97
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
98
|
+
try:
|
99
|
+
return project_api.update(uuid=uuid, name=project_name)
|
100
|
+
except HTTPError as e:
|
101
|
+
return error_handler(e)
|
102
|
+
|
103
|
+
|
104
|
+
@mcp.tool()
|
105
|
+
def submit_data_modeling_request(uuid: str, data_modeling_request: str) -> Dict:
|
106
|
+
"""
|
107
|
+
Submit a data modeling request for a GibsonAI project.
|
108
|
+
<IMPORTANT>
|
109
|
+
This tool fully handles all data modeling.
|
110
|
+
If the user describes a specific data modeling task, call this tool with the user's request as-is.
|
111
|
+
If the user's request is not clear, ask for clarification before calling this tool.
|
112
|
+
</IMPORTANT>
|
113
|
+
Returns the response from GibsonAI's LLM.
|
114
|
+
"""
|
115
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
116
|
+
try:
|
117
|
+
return project_api.submit_message(uuid=uuid, message=data_modeling_request)
|
118
|
+
except HTTPError as e:
|
119
|
+
return error_handler(e)
|
120
|
+
|
121
|
+
|
122
|
+
@mcp.tool()
|
123
|
+
def deploy_project(uuid: str) -> None:
|
124
|
+
"""
|
125
|
+
Deploy a GibsonAI project's hosted databases.
|
126
|
+
<IMPORTANT>
|
127
|
+
This updates both the development and production database schemas simultaneously by automatically handling necessary schema migrations.
|
128
|
+
</IMPORTANT>
|
129
|
+
"""
|
130
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
131
|
+
try:
|
132
|
+
return project_api.deploy(uuid=uuid)
|
133
|
+
except HTTPError as e:
|
134
|
+
return error_handler(e)
|
135
|
+
|
136
|
+
|
137
|
+
@mcp.tool()
|
138
|
+
def get_project_schema(uuid: str) -> str:
|
139
|
+
"""
|
140
|
+
Get the current schema for a GibsonAI project.
|
141
|
+
<IMPORTANT>
|
142
|
+
This includes any changes made to the schema since the last deployment.
|
143
|
+
</IMPORTANT>
|
144
|
+
"""
|
145
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
146
|
+
try:
|
147
|
+
return project_api.schema(uuid=uuid)
|
148
|
+
except HTTPError as e:
|
149
|
+
return error_handler(e)
|
150
|
+
|
151
|
+
|
152
|
+
@mcp.tool()
|
153
|
+
def get_deployed_schema(uuid: str) -> str:
|
154
|
+
"""
|
155
|
+
Get the deployed schema for a GibsonAI project.
|
156
|
+
<IMPORTANT>
|
157
|
+
This is the database schema that is currently live on the project's hosted databases.
|
158
|
+
</IMPORTANT>
|
159
|
+
"""
|
160
|
+
project_api = ProjectApi(Configuration(interactive=False))
|
161
|
+
try:
|
162
|
+
return project_api.database_schema(uuid=uuid)
|
163
|
+
except HTTPError as e:
|
164
|
+
return error_handler(e)
|
165
|
+
|
166
|
+
|
167
|
+
@mcp.tool()
|
168
|
+
def query_database(api_key: str, query: str) -> List[Dict] | str | Dict:
|
169
|
+
"""
|
170
|
+
Query a GibsonAI project's hosted database using SQL. The environment-specific API key must be provided.
|
171
|
+
<IMPORTANT>
|
172
|
+
If you're not sure which environment to use, ask the user for clarification.
|
173
|
+
Always use the correct syntax for the database dialect (found in the project details).
|
174
|
+
Always wrap identifiers in the dialect appropriate quotes (backticks for MySQL, double quotes for PostgreSQL).
|
175
|
+
</IMPORTANT>
|
176
|
+
"""
|
177
|
+
data_api = DataApi(Configuration(interactive=False), api_key=api_key)
|
178
|
+
try:
|
179
|
+
response = data_api.query(query=query)
|
180
|
+
return response or "Query executed successfully"
|
181
|
+
except HTTPError as e:
|
182
|
+
return error_handler(e)
|
gibson_cli-0.8.2/bin/release.sh
DELETED
@@ -1,136 +0,0 @@
|
|
1
|
-
from typing import Dict, List
|
2
|
-
|
3
|
-
from mcp.server.fastmcp import FastMCP
|
4
|
-
from requests.exceptions import HTTPError
|
5
|
-
|
6
|
-
from gibson.api.DataApi import DataApi
|
7
|
-
from gibson.api.ProjectApi import ProjectApi
|
8
|
-
from gibson.core.Configuration import Configuration
|
9
|
-
|
10
|
-
mcp = FastMCP("GibsonAI")
|
11
|
-
|
12
|
-
# Note: Resources are not yet supported by Cursor, everything must be implemented as a tool
|
13
|
-
# See https://docs.cursor.com/context/model-context-protocol#limitations
|
14
|
-
|
15
|
-
|
16
|
-
@mcp.tool()
|
17
|
-
def get_projects() -> List[Dict]:
|
18
|
-
"""Get all GibsonAI projects"""
|
19
|
-
project_api = ProjectApi(Configuration())
|
20
|
-
try:
|
21
|
-
return project_api.list()
|
22
|
-
except HTTPError as e:
|
23
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
24
|
-
|
25
|
-
|
26
|
-
@mcp.tool()
|
27
|
-
def create_project() -> Dict:
|
28
|
-
"""Create a new GibsonAI project"""
|
29
|
-
project_api = ProjectApi(Configuration())
|
30
|
-
try:
|
31
|
-
return project_api.create()
|
32
|
-
except HTTPError as e:
|
33
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
34
|
-
|
35
|
-
|
36
|
-
@mcp.tool()
|
37
|
-
def get_project_details(uuid: str) -> Dict:
|
38
|
-
"""Get a GibsonAI project's details"""
|
39
|
-
project_api = ProjectApi(Configuration())
|
40
|
-
try:
|
41
|
-
return project_api.lookup(uuid=uuid)
|
42
|
-
except HTTPError as e:
|
43
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
44
|
-
|
45
|
-
|
46
|
-
@mcp.tool()
|
47
|
-
def get_project_hosted_api_details(uuid: str) -> str:
|
48
|
-
"""
|
49
|
-
Get a GibsonAI project's hosted API details
|
50
|
-
This includes necessary context for an LLM to understand and generate API calls related to fetching or modifying the project's data
|
51
|
-
"""
|
52
|
-
project_api = ProjectApi(Configuration())
|
53
|
-
try:
|
54
|
-
return project_api.mcp(uuid=uuid)
|
55
|
-
except HTTPError as e:
|
56
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
57
|
-
|
58
|
-
|
59
|
-
@mcp.tool()
|
60
|
-
def update_project(uuid: str, project_name: str) -> Dict:
|
61
|
-
"""
|
62
|
-
Update a GibsonAI project's details
|
63
|
-
This currently only updates the project's name
|
64
|
-
Returns the updated project details
|
65
|
-
"""
|
66
|
-
project_api = ProjectApi(Configuration())
|
67
|
-
try:
|
68
|
-
return project_api.update(uuid=uuid, name=project_name)
|
69
|
-
except HTTPError as e:
|
70
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
71
|
-
|
72
|
-
|
73
|
-
@mcp.tool()
|
74
|
-
def submit_data_modeling_request(uuid: str, data_modeling_request: str) -> Dict:
|
75
|
-
"""
|
76
|
-
Submit a data modeling request for a GibsonAI project
|
77
|
-
This tool fully handles all data modeling, you should provide the user's request as-is
|
78
|
-
Returns the response from the LLM
|
79
|
-
"""
|
80
|
-
project_api = ProjectApi(Configuration())
|
81
|
-
try:
|
82
|
-
return project_api.submit_message(uuid=uuid, message=data_modeling_request)
|
83
|
-
except HTTPError as e:
|
84
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
85
|
-
|
86
|
-
|
87
|
-
@mcp.tool()
|
88
|
-
def deploy_project(uuid: str) -> None:
|
89
|
-
"""
|
90
|
-
Deploy a GibsonAI project's hosted databases
|
91
|
-
This deploys both the development and production databases simultaneously and automatically handles the migrations
|
92
|
-
"""
|
93
|
-
project_api = ProjectApi(Configuration())
|
94
|
-
try:
|
95
|
-
return project_api.deploy(uuid=uuid)
|
96
|
-
except HTTPError as e:
|
97
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
98
|
-
|
99
|
-
|
100
|
-
@mcp.tool()
|
101
|
-
def get_project_schema(uuid: str) -> str:
|
102
|
-
"""
|
103
|
-
Get the schema for a GibsonAI project
|
104
|
-
This includes any changes made to the schema since the last deployment
|
105
|
-
"""
|
106
|
-
project_api = ProjectApi(Configuration())
|
107
|
-
try:
|
108
|
-
return project_api.schema(uuid=uuid)
|
109
|
-
except HTTPError as e:
|
110
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
111
|
-
|
112
|
-
|
113
|
-
@mcp.tool()
|
114
|
-
def get_deployed_schema(uuid: str) -> str:
|
115
|
-
"""
|
116
|
-
Get the deployed schema for a GibsonAI project
|
117
|
-
This is the schema that is currently live on the project's hosted databases
|
118
|
-
"""
|
119
|
-
project_api = ProjectApi(Configuration())
|
120
|
-
try:
|
121
|
-
return project_api.database_schema(uuid=uuid)
|
122
|
-
except HTTPError as e:
|
123
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
124
|
-
|
125
|
-
|
126
|
-
@mcp.tool()
|
127
|
-
def query_database(api_key: str, query: str) -> List[Dict] | None | Dict:
|
128
|
-
"""
|
129
|
-
Query a GibsonAI project's hosted database using SQL
|
130
|
-
Note: the environment-specific API key must be provided
|
131
|
-
"""
|
132
|
-
data_api = DataApi(Configuration(), api_key=api_key)
|
133
|
-
try:
|
134
|
-
return data_api.query(query=query)
|
135
|
-
except HTTPError as e:
|
136
|
-
return {"status_code": e.response.status_code, "error": e.response.json()}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/BaseCustomization.py
RENAMED
File without changes
|
{gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/services/code/customization/CustomizationManager.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/constraints/ReferenceConstraint.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gibson_cli-0.8.2 → gibson_cli-0.8.4}/gibson/structure/mysql/tests/test_structure_mysql_Entity.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|