You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Integration-MCP.md
+15-19Lines changed: 15 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
!!! pied-piper ":bulb: TL;DR - MCP: Enable Bus Users to use NL to create multi-step execution flows"
2
2
3
-
MCP enables Business Users to use Natural Language to create multi-step execution flows across existing business-rule-enforced APIs. For example:
3
+
MCP enables Business Users to use Natural Language to create multi-step execution flows across existing business-rule-enforced APIs. For example, a Business User might request:
4
4
5
-
*find the overdue orders, and send an email offering a discount*.
5
+
*Find the overdue orders, and send an email offering a discount*.
6
6
7
-
This is a new request, composed from existing steps (find orders, send email).
7
+
This is a new request, composed from existing services (find orders, send email).
8
8
9
9
MCP is an open protocol than enables:
10
10
11
-
1. **MCP Client Executors** to discover servers (tools) - their schema, etc.
11
+
1. **MCP Client Executors** to discover servers (tools) - their schema, instructions, etc.
12
12
2. MCP Client Executors to call LLMs to translate NL queries into multi-step execution flows called **Tool Context Blocks.**.
13
-
3. The MCP Client Executors to execute the Tool Context Block steps, making calls on the **MCP Server Executors.**
13
+
3. The MCP Client Executors to process the Tool Context Block steps, making calls on the **MCP Server Executors.**
14
14
15
15
* MCP Server Executors are commonly provided via **logic-enabled JSON:APIs.** (Note the logic is critical in maintaining integrity and security.)
16
16
17
17
In some cases, you may have a database, but neither the APIs nor the logic. GenAI-Logic API Logic Server can **mcp-ify existing databases** by:
18
18
19
-
4. Creating JSON:APIs for existing databases with a single CLI command
20
-
5. Enabling you to [declare business logic](Logic.md), which can be used via the APIs in MCP executipn flows.
19
+
1. Creating JSON:APIs for *existing databases* with a single CLI command
20
+
2. Enabling you to [declare business logic](Logic.md), which can be used via the APIs in MCP execution flows.
21
21
22
22
23
23
@@ -66,6 +66,7 @@ Create the **basic_demo** under the [Manager](Manager.md) as described in the Ma
66
66
2. Run `als add-cust` to load mcp (and logic)
67
67
3. Start the Server (f5)
68
68
4. Run `python integration/mcp/mcp_client_executor.py`
69
+
* You can use Run Config: **Run designated Python file**
69
70
70
71
71
72
The [basic_demo](Sample-Basic-Demo.md){:target="_blank" rel="noopener"} project illustrates basic GenAI-Logic operation: creating projects from new or existing databases, adding logic and security, and customizing your project using your IDE and Python.
@@ -78,16 +79,10 @@ You will need an environment variable: `APILOGICSERVER_CHATGPT_APIKEY` ChatGPT A
78
79
Here is a NL prompt using *basic_demo* coded into `mcp_client_executor`
79
80
80
81
```
81
-
List the orders created more than 30 days ago, and send a discount offer email to the customer for each one.
82
-
83
-
Respond with a JSON array of tool context blocks using:
- Use {{ order.customer_id }} as a placeholder in the second step.
87
-
- Include method, url, query_params or body, headers, expected_output.
82
+
List the unshipped orders created before 2023-07-14, and send a discount email (subject: 'Discount Offer') to the customer for each one.
88
83
```
89
84
90
-
%nbsp;
85
+
91
86
92
87
### Sample Flow
93
88
@@ -103,16 +98,17 @@ Here is the basic driver of the test program (see the Architecture diagram above
103
98
Discovery uses a config file `integration/mcp/mcp_server_discovery.json` to discover 1 or more servers, and invoke their `.well-known` endpoint (see `api/api_discovery/mcp_discovery.py`) to obtain the schema.
We call the LLM, providing the NL Query and the discovered schema returned above. Note the schema includes:
109
105
110
106
1. resources: the schema itself
111
107
* You would typically edit this file to expose only desired data, and reduce the size of the prompt
112
108
2. instructions on how to format `expected_response` (e.g., `query_params`)
113
-
3. how to use the **Request Pattern** to send email, subject to logic (see Logic, below):
109
+
3.and how to use the **Request Pattern** to send email, subject to logic (see Logic, below):
114
110
115
-
 The LLM returns a Tool Context completion (response), with the steps to call the MCP Server Executor, which here is the logic-enabled API Logic Server JSON:API.
111
+
 The LLM returns a Tool Context completion (response), with the steps to call the MCP Server Executor, which here is the logic-enabled API Logic Server JSON:API:
@@ -131,9 +127,9 @@ As shown below, a common [logic pattern](Logic.md#rule-patterns){:target="_blank
131
127
132
128
133
129
134
-
## Appendix: Status - Work In Progress
130
+
## Appendix: Status - End-to-End Illustration
135
131
136
-
This is an initial experiment, with significant ToDo's (security, etc). That said, it might be an excellent way to explore MCP.
132
+
This is intended to be a vehicle for exploring MCP. It is not productized - we need to explore security, and perhaps integrating this into the Admin App.
137
133
138
134
We welcome participation in this exploration. Please contact us via [discord](https://discord.gg/HcGxbBsgRF).
0 commit comments