gibson-cli 0.8.3__py3-none-any.whl → 0.8.5__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 +60 -22
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.5.dist-info}/METADATA +1 -1
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.5.dist-info}/RECORD +6 -6
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.5.dist-info}/WHEEL +1 -1
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.5.dist-info}/entry_points.txt +0 -0
- {gibson_cli-0.8.3.dist-info → gibson_cli-0.8.5.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,14 @@ 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 tasks.
|
110
|
+
The LLM should not attempt to handle any data modeling tasks.
|
111
|
+
If the user describes a data modeling task, call this tool with the user's request as-is.
|
112
|
+
Again, the LLM should never attempt to directly handle data modeling tasks when working on a GibsonAI project.
|
113
|
+
</IMPORTANT>
|
114
|
+
Returns the response from GibsonAI's data modeler.
|
88
115
|
"""
|
89
116
|
project_api = ProjectApi(Configuration(interactive=False))
|
90
117
|
try:
|
@@ -96,8 +123,10 @@ def submit_data_modeling_request(uuid: str, data_modeling_request: str) -> Dict:
|
|
96
123
|
@mcp.tool()
|
97
124
|
def deploy_project(uuid: str) -> None:
|
98
125
|
"""
|
99
|
-
Deploy a GibsonAI project's hosted databases
|
100
|
-
|
126
|
+
Deploy a GibsonAI project's hosted databases.
|
127
|
+
<IMPORTANT>
|
128
|
+
This updates both the development and production database schemas simultaneously by automatically handling necessary schema migrations.
|
129
|
+
</IMPORTANT>
|
101
130
|
"""
|
102
131
|
project_api = ProjectApi(Configuration(interactive=False))
|
103
132
|
try:
|
@@ -109,8 +138,10 @@ def deploy_project(uuid: str) -> None:
|
|
109
138
|
@mcp.tool()
|
110
139
|
def get_project_schema(uuid: str) -> str:
|
111
140
|
"""
|
112
|
-
Get the schema for a GibsonAI project
|
113
|
-
|
141
|
+
Get the current schema for a GibsonAI project.
|
142
|
+
<IMPORTANT>
|
143
|
+
This includes any changes made to the schema since the last deployment.
|
144
|
+
</IMPORTANT>
|
114
145
|
"""
|
115
146
|
project_api = ProjectApi(Configuration(interactive=False))
|
116
147
|
try:
|
@@ -122,8 +153,10 @@ def get_project_schema(uuid: str) -> str:
|
|
122
153
|
@mcp.tool()
|
123
154
|
def get_deployed_schema(uuid: str) -> str:
|
124
155
|
"""
|
125
|
-
Get the deployed schema for a GibsonAI project
|
126
|
-
|
156
|
+
Get the deployed schema for a GibsonAI project.
|
157
|
+
<IMPORTANT>
|
158
|
+
This is the database schema that is currently live on the project's hosted databases.
|
159
|
+
</IMPORTANT>
|
127
160
|
"""
|
128
161
|
project_api = ProjectApi(Configuration(interactive=False))
|
129
162
|
try:
|
@@ -133,13 +166,18 @@ def get_deployed_schema(uuid: str) -> str:
|
|
133
166
|
|
134
167
|
|
135
168
|
@mcp.tool()
|
136
|
-
def query_database(api_key: str, query: str) -> List[Dict] |
|
169
|
+
def query_database(api_key: str, query: str) -> List[Dict] | str | Dict:
|
137
170
|
"""
|
138
|
-
Query a GibsonAI project's hosted database using SQL
|
139
|
-
|
171
|
+
Query a GibsonAI project's hosted database using SQL. The environment-specific API key must be provided.
|
172
|
+
<IMPORTANT>
|
173
|
+
If you're not sure which environment to use, ask the user for clarification.
|
174
|
+
Always use the correct syntax for the database dialect (found in the project details).
|
175
|
+
Always wrap identifiers in the dialect appropriate quotes (backticks for MySQL, double quotes for PostgreSQL).
|
176
|
+
</IMPORTANT>
|
140
177
|
"""
|
141
178
|
data_api = DataApi(Configuration(interactive=False), api_key=api_key)
|
142
179
|
try:
|
143
|
-
|
180
|
+
response = data_api.query(query=query)
|
181
|
+
return response or "Query executed successfully"
|
144
182
|
except HTTPError as e:
|
145
183
|
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=_ZVbYrtRsc1xwZVfuQ60aM28UwvD7gNzwkm2f8bJMdI,6783
|
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.5.dist-info/METADATA,sha256=PHR_Rryd12ULDpsax-3Pq5hZCwyEn38ITZ7gp8Z7kfw,14592
|
133
|
+
gibson_cli-0.8.5.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
|
134
|
+
gibson_cli-0.8.5.dist-info/entry_points.txt,sha256=j5VUvq3AzL21xPvVC24zMoXFt-I5lUWulr66nL3OAPM,50
|
135
|
+
gibson_cli-0.8.5.dist-info/top_level.txt,sha256=fSV3vegbdbSDwiB6n5z3FCeYwkIonzFrx4ek3F_OSdI,16
|
136
|
+
gibson_cli-0.8.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|