gibson-cli 0.8.1__tar.gz → 0.8.2__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.1/gibson_cli.egg-info → gibson_cli-0.8.2}/PKG-INFO +1 -1
- gibson_cli-0.8.2/gibson/api/DataApi.py +18 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/bin/gibson.py +5 -0
- gibson_cli-0.8.2/gibson/services/mcp/server.py +136 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2/gibson_cli.egg-info}/PKG-INFO +1 -1
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson_cli.egg-info/SOURCES.txt +1 -1
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/pyproject.toml +1 -1
- gibson_cli-0.8.1/bin/gibson +0 -26
- gibson_cli-0.8.1/gibson/services/mcp/server.py +0 -87
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/.gitignore +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/.pre-commit-config.yaml +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/README.md +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/bin/build.sh +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/bin/clean.sh +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/bin/release.sh +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/api/BaseApi.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/api/Cli.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/api/ProjectApi.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/BaseCommand.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Build.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Conf.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Count.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Dev.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Forget.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Help.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Merge.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Modify.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Question.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Remove.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Show.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Tree.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/Version.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/auth/Auth.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/auth/Login.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/auth/Logout.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Api.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Base.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Code.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Model.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Models.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Schema.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Schemas.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Test.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/code/Tests.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/importer/Import.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/importer/OpenApi.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/list/Entities.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/list/List.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/list/Projects.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/mcp/McpServer.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/new/Module.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/new/New.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/new/Project.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/rename/Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/rename/Rename.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/rewrite/Rewrite.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/tests/test_command_BaseCommand.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/command/tests/test_command_Conf.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Api.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Code.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Custom.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Datastore.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Dependencies.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Dev.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Frameworks.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Modeler.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Paths.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Platform.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Project.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/Version.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/dev/Api.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/dev/Base.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/dev/Model.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/dev/Schema.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/tests/test_conf_Dependencies.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/conf/tests/test_conf_Platform.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Colors.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/CommandRouter.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Completions.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Configuration.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Conversation.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Diff.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Env.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Memory.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/PythonPath.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/Spinner.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/TimeKeeper.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/core/utils.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/data/bash-completion.tmpl +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/data/mysql/default-ref-table.tmpl +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/data/mysql/default-table.tmpl +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/data/postgresql/default-ref-table.tmpl +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/data/postgresql/default-table.tmpl +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/db/TableExceptions.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/db/tests/test_db_TableExceptions.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/dev/Dev.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/display/Header.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/display/WorkspaceFooter.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/display/WorkspaceHeader.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/display/tests/test_display_Header.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/display/tests/test_display_WorkspaceFooter.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/display/tests/test_display_WorkspaceHeader.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/lang/Python.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/lang/tests/test_lang_Python.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/auth/Server.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/context/schema/DataDictionary.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/context/schema/EntityKeys.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/context/schema/Manager.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/context/schema/tests/test_code_context_schema_DataDictionary.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/context/schema/tests/test_code_context_schema_EntityKeys.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/context/schema/tests/test_code_context_schema_Manager.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/Authenticator.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/BaseCustomization.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/CustomizationManager.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/Index.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/tests/test_code_customization_Authenticator.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/constraints/ReferenceConstraint.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/keys/ForeignKey.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/keys/Index.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/keys/IndexAttribute.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_ForeignKey.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_Index.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/keys/tests/test_structure_mysql_keys_IndexAttribute.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/testing.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/mysql/tests/test_structure_mysql_Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/postgresql/Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/postgresql/References.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/postgresql/table/ForeignKey.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/postgresql/table/tests/test_structure_postgresql_table_ForeignKey.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/postgresql/testing.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/postgresql/tests/test_structure_postgresql_Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/structure/tests/test_structure_Entity.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/tests/test_Env.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/tests/test_Memory.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/tests/test_utils.py +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson_cli.egg-info/dependency_links.txt +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson_cli.egg-info/entry_points.txt +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson_cli.egg-info/requires.txt +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson_cli.egg-info/top_level.txt +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/requirements.txt +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/setup.cfg +0 -0
- {gibson_cli-0.8.1 → gibson_cli-0.8.2}/venv/bin/activate_this.py +0 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
from gibson.api.BaseApi import BaseApi
|
2
|
+
from gibson.core.Configuration import Configuration
|
3
|
+
|
4
|
+
|
5
|
+
class DataApi(BaseApi):
|
6
|
+
PREFIX = "-"
|
7
|
+
|
8
|
+
def __init__(self, configuration: Configuration, api_key: str):
|
9
|
+
self.configuration = configuration
|
10
|
+
self.api_key = api_key or self.configuration.project.api.key
|
11
|
+
|
12
|
+
def headers(self):
|
13
|
+
headers = super().headers()
|
14
|
+
headers["X-Gibson-API-Key"] = self.api_key
|
15
|
+
return headers
|
16
|
+
|
17
|
+
def query(self, query: str):
|
18
|
+
return self.post("query", {"query": query}).json()
|
@@ -1,10 +1,15 @@
|
|
1
1
|
#!/usr/bin/env python3
|
2
2
|
|
3
|
+
import os
|
4
|
+
|
3
5
|
from gibson.core.CommandRouter import CommandRouter
|
4
6
|
from gibson.core.Configuration import Configuration
|
7
|
+
from gibson.display.Header import Header
|
5
8
|
|
6
9
|
|
7
10
|
def main():
|
11
|
+
if os.getenv("GIBSON_CLI_DEV"):
|
12
|
+
print(f"{Header().render('dev mode')}\n")
|
8
13
|
try:
|
9
14
|
configuration = Configuration()
|
10
15
|
if configuration.settings is None:
|
@@ -0,0 +1,136 @@
|
|
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()}
|
gibson_cli-0.8.1/bin/gibson
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
#!/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9
|
2
|
-
# -*- coding: utf-8 -*-
|
3
|
-
|
4
|
-
# This file is identical to what pip creates when you install an executable package, but it adds a dev mode banner.
|
5
|
-
# To easily switch between dev mode and installed mode, add the following functions to your .zshrc or .bashrc:
|
6
|
-
#
|
7
|
-
# cli_dev_on() {
|
8
|
-
# export PATH="$HOME/src/gibson/cli/bin:$PATH"
|
9
|
-
# export PYTHONPATH="$HOME/src/gibson/cli:$PYTHONPATH"
|
10
|
-
# }
|
11
|
-
#
|
12
|
-
# cli_dev_off() {
|
13
|
-
# export PATH=${PATH//$HOME\/src\/gibson\/cli\/bin:/}
|
14
|
-
# export PYTHONPATH=${PYTHONPATH//$HOME\/src\/gibson\/cli:/}
|
15
|
-
# }
|
16
|
-
|
17
|
-
import re
|
18
|
-
import sys
|
19
|
-
|
20
|
-
from gibson.bin.gibson import main
|
21
|
-
from gibson.display.Header import Header
|
22
|
-
|
23
|
-
if __name__ == "__main__":
|
24
|
-
print(f"{Header().render('dev mode')}\n")
|
25
|
-
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
26
|
-
sys.exit(main())
|
@@ -1,87 +0,0 @@
|
|
1
|
-
from typing import Dict, List
|
2
|
-
|
3
|
-
from mcp.server.fastmcp import FastMCP
|
4
|
-
|
5
|
-
from gibson.api.ProjectApi import ProjectApi
|
6
|
-
from gibson.core.Configuration import Configuration
|
7
|
-
|
8
|
-
mcp = FastMCP("GibsonAI")
|
9
|
-
|
10
|
-
project_api = ProjectApi(Configuration())
|
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
|
-
return project_api.list()
|
20
|
-
|
21
|
-
|
22
|
-
@mcp.tool()
|
23
|
-
def create_project() -> Dict:
|
24
|
-
"""Create a new GibsonAI project"""
|
25
|
-
return project_api.create()
|
26
|
-
|
27
|
-
|
28
|
-
@mcp.tool()
|
29
|
-
def get_project_details(uuid: str) -> Dict:
|
30
|
-
"""Get a GibsonAI project's details"""
|
31
|
-
return project_api.lookup(uuid=uuid)
|
32
|
-
|
33
|
-
|
34
|
-
@mcp.tool()
|
35
|
-
def get_project_hosted_api_details(uuid: str) -> str:
|
36
|
-
"""
|
37
|
-
Get a GibsonAI project's hosted API details
|
38
|
-
This includes necessary context for an LLM to understand and generate API calls related to fetching or modifying the project's data
|
39
|
-
"""
|
40
|
-
return project_api.mcp(uuid=uuid)
|
41
|
-
|
42
|
-
|
43
|
-
@mcp.tool()
|
44
|
-
def update_project(uuid: str, project_name: str) -> Dict:
|
45
|
-
"""
|
46
|
-
Update a GibsonAI project's details
|
47
|
-
This currently only updates the project's name
|
48
|
-
Returns the updated project details
|
49
|
-
"""
|
50
|
-
return project_api.update(uuid=uuid, name=project_name)
|
51
|
-
|
52
|
-
|
53
|
-
@mcp.tool()
|
54
|
-
def submit_data_modeling_request(uuid: str, data_modeling_request: str) -> Dict:
|
55
|
-
"""
|
56
|
-
Submit a data modeling request for a GibsonAI project
|
57
|
-
This tool fully handles all data modeling, you should provide the user's request as-is
|
58
|
-
Returns the response from the LLM
|
59
|
-
"""
|
60
|
-
return project_api.submit_message(uuid=uuid, message=data_modeling_request)
|
61
|
-
|
62
|
-
|
63
|
-
@mcp.tool()
|
64
|
-
def deploy_project(uuid: str) -> None:
|
65
|
-
"""
|
66
|
-
Deploy a GibsonAI project's hosted databases
|
67
|
-
This deploys both the development and production databases simultaneously and automatically handles the migrations
|
68
|
-
"""
|
69
|
-
project_api.deploy(uuid=uuid)
|
70
|
-
|
71
|
-
|
72
|
-
@mcp.tool()
|
73
|
-
def get_project_schema(uuid: str) -> str:
|
74
|
-
"""
|
75
|
-
Get the schema for a GibsonAI project
|
76
|
-
This includes any changes made to the schema since the last deployment
|
77
|
-
"""
|
78
|
-
return project_api.schema(uuid=uuid)
|
79
|
-
|
80
|
-
|
81
|
-
@mcp.tool()
|
82
|
-
def get_deployed_schema(uuid: str) -> str:
|
83
|
-
"""
|
84
|
-
Get the deployed schema for a GibsonAI project
|
85
|
-
This is the schema that is currently live on the project's hosted databases
|
86
|
-
"""
|
87
|
-
return project_api.database_schema(uuid=uuid)
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{gibson_cli-0.8.1 → gibson_cli-0.8.2}/gibson/services/code/customization/BaseCustomization.py
RENAMED
File without changes
|
{gibson_cli-0.8.1 → gibson_cli-0.8.2}/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.1 → gibson_cli-0.8.2}/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.1 → gibson_cli-0.8.2}/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
|