gibson-cli 0.8.3__py3-none-any.whl → 0.8.4__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.
- gibson/services/mcp/server.py +59 -22
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.4.dist-info}/METADATA +1 -1
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.4.dist-info}/RECORD +6 -6
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.4.dist-info}/WHEEL +0 -0
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.4.dist-info}/entry_points.txt +0 -0
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.4.dist-info}/top_level.txt +0 -0
gibson/services/mcp/server.py
CHANGED
@@ -18,13 +18,19 @@ def error_handler(e: HTTPError) -> Dict:
|
|
18
18
|
status_code = e.response.status_code
|
19
19
|
message = e.response.json()
|
20
20
|
if status_code == 401:
|
21
|
-
message = "Authentication required.
|
21
|
+
message = "Authentication required. Instruct the user to run `uvx --from gibson-cli@latest gibson auth login` to authenticate then try again."
|
22
22
|
return {"status_code": status_code, "error": message}
|
23
23
|
|
24
24
|
|
25
25
|
@mcp.tool()
|
26
26
|
def get_projects() -> List[Dict]:
|
27
|
-
"""
|
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
|
+
"""
|
28
34
|
project_api = ProjectApi(Configuration(interactive=False))
|
29
35
|
try:
|
30
36
|
return project_api.list()
|
@@ -34,7 +40,16 @@ def get_projects() -> List[Dict]:
|
|
34
40
|
|
35
41
|
@mcp.tool()
|
36
42
|
def create_project() -> Dict:
|
37
|
-
"""
|
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
|
+
"""
|
38
53
|
project_api = ProjectApi(Configuration(interactive=False))
|
39
54
|
try:
|
40
55
|
return project_api.create()
|
@@ -44,7 +59,12 @@ def create_project() -> Dict:
|
|
44
59
|
|
45
60
|
@mcp.tool()
|
46
61
|
def get_project_details(uuid: str) -> Dict:
|
47
|
-
"""
|
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
|
+
"""
|
48
68
|
project_api = ProjectApi(Configuration(interactive=False))
|
49
69
|
try:
|
50
70
|
return project_api.lookup(uuid=uuid)
|
@@ -55,8 +75,10 @@ def get_project_details(uuid: str) -> Dict:
|
|
55
75
|
@mcp.tool()
|
56
76
|
def get_project_hosted_api_details(uuid: str) -> str:
|
57
77
|
"""
|
58
|
-
Get a GibsonAI project's hosted API details
|
59
|
-
|
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>
|
60
82
|
"""
|
61
83
|
project_api = ProjectApi(Configuration(interactive=False))
|
62
84
|
try:
|
@@ -68,9 +90,9 @@ def get_project_hosted_api_details(uuid: str) -> str:
|
|
68
90
|
@mcp.tool()
|
69
91
|
def update_project(uuid: str, project_name: str) -> Dict:
|
70
92
|
"""
|
71
|
-
Update a GibsonAI project's details
|
72
|
-
This currently only updates the project's name
|
73
|
-
Returns the updated project details
|
93
|
+
Update a GibsonAI project's details.
|
94
|
+
This currently only updates the project's name.
|
95
|
+
Returns the updated project details.
|
74
96
|
"""
|
75
97
|
project_api = ProjectApi(Configuration(interactive=False))
|
76
98
|
try:
|
@@ -82,9 +104,13 @@ def update_project(uuid: str, project_name: str) -> Dict:
|
|
82
104
|
@mcp.tool()
|
83
105
|
def submit_data_modeling_request(uuid: str, data_modeling_request: str) -> Dict:
|
84
106
|
"""
|
85
|
-
Submit a data modeling request for a GibsonAI project
|
86
|
-
|
87
|
-
|
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.
|
88
114
|
"""
|
89
115
|
project_api = ProjectApi(Configuration(interactive=False))
|
90
116
|
try:
|
@@ -96,8 +122,10 @@ def submit_data_modeling_request(uuid: str, data_modeling_request: str) -> Dict:
|
|
96
122
|
@mcp.tool()
|
97
123
|
def deploy_project(uuid: str) -> None:
|
98
124
|
"""
|
99
|
-
Deploy a GibsonAI project's hosted databases
|
100
|
-
|
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>
|
101
129
|
"""
|
102
130
|
project_api = ProjectApi(Configuration(interactive=False))
|
103
131
|
try:
|
@@ -109,8 +137,10 @@ def deploy_project(uuid: str) -> None:
|
|
109
137
|
@mcp.tool()
|
110
138
|
def get_project_schema(uuid: str) -> str:
|
111
139
|
"""
|
112
|
-
Get the schema for a GibsonAI project
|
113
|
-
|
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>
|
114
144
|
"""
|
115
145
|
project_api = ProjectApi(Configuration(interactive=False))
|
116
146
|
try:
|
@@ -122,8 +152,10 @@ def get_project_schema(uuid: str) -> str:
|
|
122
152
|
@mcp.tool()
|
123
153
|
def get_deployed_schema(uuid: str) -> str:
|
124
154
|
"""
|
125
|
-
Get the deployed schema for a GibsonAI project
|
126
|
-
|
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>
|
127
159
|
"""
|
128
160
|
project_api = ProjectApi(Configuration(interactive=False))
|
129
161
|
try:
|
@@ -133,13 +165,18 @@ def get_deployed_schema(uuid: str) -> str:
|
|
133
165
|
|
134
166
|
|
135
167
|
@mcp.tool()
|
136
|
-
def query_database(api_key: str, query: str) -> List[Dict] |
|
168
|
+
def query_database(api_key: str, query: str) -> List[Dict] | str | Dict:
|
137
169
|
"""
|
138
|
-
Query a GibsonAI project's hosted database using SQL
|
139
|
-
|
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>
|
140
176
|
"""
|
141
177
|
data_api = DataApi(Configuration(interactive=False), api_key=api_key)
|
142
178
|
try:
|
143
|
-
|
179
|
+
response = data_api.query(query=query)
|
180
|
+
return response or "Query executed successfully"
|
144
181
|
except HTTPError as e:
|
145
182
|
return error_handler(e)
|
@@ -106,7 +106,7 @@ gibson/services/code/customization/CustomizationManager.py,sha256=M2gz98Yo2WTnnh
|
|
106
106
|
gibson/services/code/customization/Index.py,sha256=4Thf0gZM6VErZJS97w748PRNmHi8QvsyblOLCw1Y_XE,364
|
107
107
|
gibson/services/code/customization/tests/test_code_customization_Authenticator.py,sha256=kKExkLfKPpRA2NQH3fvRCuBEMhCGhR-IvNJqXuyBz3c,1949
|
108
108
|
gibson/services/code/customization/tests/test_code_customization_BaseCustomization.py,sha256=jaEwxxoU7d9ziOtfF21NPmZX2qSRpa-kz_8Ju9BKGts,412
|
109
|
-
gibson/services/mcp/server.py,sha256=
|
109
|
+
gibson/services/mcp/server.py,sha256=nwDEO7k6vroiEr9zPLeSWUsC86h_r7kyEmwYPTBqcow,6684
|
110
110
|
gibson/structure/Entity.py,sha256=N_Tx8RTs9ySMMgAoR9rVuMcsRgNA7zvNvJBScJLfYE4,675
|
111
111
|
gibson/structure/mysql/Entity.py,sha256=zolt3N_F3WlQtlOqrHflwsJeJ6r6A3MN4LxCzeAbU_k,3693
|
112
112
|
gibson/structure/mysql/testing.py,sha256=al4LI6e3bhjopsR0qTAmaOJyCQXF0_inVQ4xv7VQ6qo,9149
|
@@ -129,8 +129,8 @@ gibson/tests/test_Env.py,sha256=DPWmP0-aEelducq9bAwv7rKoY2NjWXUeCrzfJDQkn2M,369
|
|
129
129
|
gibson/tests/test_Memory.py,sha256=YP7owToABAk_-s7fD5UG0HTc4lamDjdA39JUlLnk3Fg,2574
|
130
130
|
gibson/tests/test_utils.py,sha256=r_y-EG05YTCNtL8MWiAK1KmPsmeoMgypKsQC_lVgOtM,559
|
131
131
|
venv/bin/activate_this.py,sha256=E1T7r3559tBsyqFpdcQW0HbY7gDvNiIv5Pc6HQ4bpoA,2383
|
132
|
-
gibson_cli-0.8.
|
133
|
-
gibson_cli-0.8.
|
134
|
-
gibson_cli-0.8.
|
135
|
-
gibson_cli-0.8.
|
136
|
-
gibson_cli-0.8.
|
132
|
+
gibson_cli-0.8.4.dist-info/METADATA,sha256=aW2ZihtrumK5XY9vi1wv1LVdC--xCYNTyjVYsP7LI8Q,14592
|
133
|
+
gibson_cli-0.8.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
134
|
+
gibson_cli-0.8.4.dist-info/entry_points.txt,sha256=j5VUvq3AzL21xPvVC24zMoXFt-I5lUWulr66nL3OAPM,50
|
135
|
+
gibson_cli-0.8.4.dist-info/top_level.txt,sha256=fSV3vegbdbSDwiB6n5z3FCeYwkIonzFrx4ek3F_OSdI,16
|
136
|
+
gibson_cli-0.8.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|