Skip to content

Commit d3eb821

Browse files
author
deec
committed
updates to README.md
1 parent 96fbc75 commit d3eb821

File tree

1 file changed

+87
-16
lines changed

1 file changed

+87
-16
lines changed

README.md

Lines changed: 87 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
![CI](https://github.com/djecon-sag/CONNX_MCP_Sample/actions/workflows/ci.yml/badge.svg)
22

3-
# CONNX MCP Server
3+
## Table of Contents
4+
5+
- [Overview](#connx-mcp-server)
6+
- [Sample Features](#features)
7+
- [Installation](#installation)
8+
- [Usage](#usage)
9+
- [MCP Tools](#mcp-tools)
10+
- [`query_connx`](#query_connx)
11+
- [`update_connx`](#update_connx)
12+
- [MCP Resources](#mcp-resources)
13+
- [MCP Client Examples](#mcp-client-examples)
14+
- [Extending MCP Tools](#extending-mcp-tools)
15+
- [Summary](#summary)
16+
- [What is MCP?](#what-is-mcp)
17+
18+
19+
## CONNX MCP Server
420

521
An unofficial MCP (Model Context Protocol) server for integrating with CONNX databases. This allows AI agents (e.g., Claude) to securely query and update data via standardized tools.
622

@@ -18,12 +34,6 @@ An unofficial MCP (Model Context Protocol) server for integrating with CONNX dat
1834
## Usage
1935
Run: `python connx_server.py`
2036

21-
## MCP Tools
22-
23-
This server exposes functionality through **MCP tools**, allowing clients to execute database operations against CONNX-connected data sources using structured, validated entry points.
24-
25-
MCP tools provide a safe, well-defined interface for interacting with CONNX-backed data without exposing raw database connections to clients.
26-
2737
---
2838
## MCP Tools
2939

@@ -64,14 +74,14 @@ query (str): SQL SELECT statement
6474
- Automatically sanitizes input to reduce SQL injection risk
6575

6676
## Return format
67-
```python
68-
{
69-
"results": [
70-
{ "COLUMN1": "value", "COLUMN2": 123 },
71-
...
72-
],
73-
"count": 10
74-
}
77+
```json
78+
{
79+
"results": [
80+
{ "COLUMN1": "value", "COLUMN2": 123 },
81+
...
82+
],
83+
"count": 10
84+
}
7585
```
7686

7787
## Example
@@ -98,7 +108,7 @@ Executes data-modifying SQL statements (INSERT, UPDATE, DELETE) via CONNX.
98108
• Commits on success, rolls back on failure
99109

100110
## Return format
101-
```python
111+
```json
102112
{
103113
"affected_rows": 5,
104114
"message": "Update completed successfully."
@@ -110,7 +120,29 @@ UPDATE CUSTOMERS
110120
SET STATUS = 'INACTIVE'
111121
WHERE LAST_LOGIN < '2022-01-01'
112122
```
123+
## MCP Client Examples
124+
125+
Below are examples of how MCP-compatible clients (such as Claude Desktop or other MCP hosts) can invoke the CONNX MCP Server.
126+
127+
### Example: Query Data
113128

129+
```json
130+
{
131+
"tool": "query_connx",
132+
"arguments": {
133+
"query": "SELECT CUSTOMER_ID, CUSTOMER_NAME FROM CUSTOMERS WHERE STATE = 'CA'"
134+
}
135+
}
136+
```
137+
## Response
138+
```json
139+
{
140+
"results": [
141+
{ "CUSTOMER_ID": "C001", "CUSTOMER_NAME": "Acme Corp" }
142+
],
143+
"count": 1
144+
}
145+
```
114146
---
115147

116148
## Integrate in MCP host config:
@@ -180,4 +212,43 @@ async def count_connx(table_name: str) -> Dict[str, Any]:
180212
"table": "CUSTOMERS"
181213
}
182214
```
215+
---
216+
## What is MCP?
217+
The Model Context Protocol (MCP) is an open-source standard developed by Anthropic and launched in November 2024. It enables AI models and applications to securely connect to and interact with external data sources, tools, and workflows through a standardized interface.
218+
219+
MCP acts as a universal "USB-C" port for AI, allowing seamless integrations without the need for custom code for each connection. This protocol builds on existing concepts like tool use and function calling but standardizes them, reducing the fragmentation in AI integrations. By providing access to live, real-world data, MCP empowers large language models (LLMs) like Claude to perform tasks, deliver accurate insights, and handle actions that extend beyond their original training data.
220+
221+
MCP addresses the challenge of AI models being isolated from real-time data and external capabilities. It enables LLMs to:
222+
- Access current data from diverse sources.
223+
- Perform actions on behalf of users, such as querying databases or sending emails.
224+
- Utilize specialized tools and workflows without custom integrations.
225+
226+
227+
---
228+
## Building Blocks
229+
MCP servers expose capabilities through three primary building blocks, which standardize how AI applications interact with external systems:
230+
231+
| Feature | Explanation | Examples | Who Controls It |
232+
|-----------|-----------------------------------------------------------------------------|-----------------------------------|-----------------|
233+
| **Tools** | Active functions that the LLM can invoke based on user requests. These can perform actions like writing to databases, calling APIs, or modifying files. Hosts must obtain user consent before invocation. | Search flights, send messages, create calendar events | Model (LLM decides when to call) |
234+
| **Resources** | Passive, read-only data sources providing context, such as file contents, database schemas, or API documentation. | Retrieve documents, access knowledge bases, read calendars | Application (host manages access) |
235+
| **Prompts** | Pre-built templates or workflows that guide the LLM in using tools and resources effectively. | Plan a vacation, summarize meetings, draft an email | User (selects or customizes) |
236+
237+
---
238+
## How MCP Works
239+
At its core, MCP allows an LLM to request assistance from external systems to fulfill user queries. The process involves discovery, invocation, execution, and response.
240+
241+
### Simplified Workflow Example
242+
Consider a user query: "Find the latest sales report in our database and email it to my manager."
243+
244+
1. **Request and Discovery**: The LLM recognizes it needs external access (e.g., database query and email sending). Via the MCP client, it discovers available servers and relevant tools, such as `database_query` and `email_sender`.
245+
246+
2. **Tool Invocation**: The LLM generates a structured request. The client sends it to the appropriate server (e.g., first invoking `database_query` with the report details).
247+
248+
3. **External Action and Response**: The server translates the request (e.g., into a secure SQL query), executes it on the backend system, retrieves the data, and returns it in a formatted response to the client.
249+
250+
4. **Subsequent Actions**: With the data, the LLM invokes the next tool (e.g., `email_sender`), and the server confirms completion.
251+
252+
5. **Final Response**: The LLM replies to the user: "I have found the latest sales report and emailed it to your manager."
183253

254+
This bidirectional flow ensures efficient, secure interactions. Real-world examples include generating web apps from Figma designs, analyzing data across multiple databases via natural language, or creating 3D models in Blender for printing.

0 commit comments

Comments
 (0)