Skip to content

Commit d8dd3f2

Browse files
author
deec
committed
updates to README.md and connx_server.py
1 parent 5d41305 commit d8dd3f2

File tree

5 files changed

+563
-252
lines changed

5 files changed

+563
-252
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,11 @@ jobs:
3535
- name: Run unit tests (exclude integration) + coverage
3636
shell: pwsh
3737
run: |
38-
pytest -m "not integration" --cov=connx_server --cov-report=term-missing --cov-fail-under=90
38+
pytest -m "not integration" --cov=connx_server --cov-report=term-missing --cov-fail-under=90
39+
40+
- name: Show versions
41+
shell: pwsh
42+
run: |
43+
python --version
44+
pip --version
45+
pytest --version

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,15 @@ Below are examples of how MCP-compatible clients (such as Claude Desktop or othe
210210
}
211211
}
212212
```
213-
213+
---
214+
## Sample Questions
215+
1. “How many customers do we have in total?”
216+
2. “Which customers live in California?”
217+
3. “Which customers are in San Francisco?”
218+
4. “How many customers do we have in each state?”
219+
5. “Show me details for customer Z3375.”
220+
6. “Do we have any customers missing phone numbers?”
221+
7. "What products are most frequently ordered by customers?"
214222
---
215223

216224
## Testing

Security.md

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This repository contains a reference implementation of an MCP (Model Context Pro
66

77
While security best practices are followed, this project is not a hardened production system. Users are responsible for evaluating and extending the security controls to meet their own organizational and regulatory requirements.
88

9-
9+
---
1010

1111
### Supported Versions
1212

@@ -15,18 +15,18 @@ Only the latest version on the main branch is supported.
1515
Security fixes will be applied to main only.
1616
No backporting is provided.
1717

18-
18+
---
1919

2020
### Security Design Principles
2121

2222
This project follows these guiding principles:
23-
Safe by default
24-
Least privilege
25-
Explicit enablement for destructive actions
26-
No trust in AI-generated SQL
27-
Defense in depth
23+
* Safe by default
24+
* Least privilege
25+
* Explicit enablement for destructive actions
26+
* No trust in AI-generated SQL
27+
* Defense in depth
2828

29-
29+
---
3030

3131
### Authentication & Credentials
3232
- Database credentials are supplied only via environment variables
@@ -38,129 +38,129 @@ Recommended:
3838
- Use OS-level environment variables in production
3939
- Use secret managers (Azure Key Vault, AWS Secrets Manager, etc.)
4040

41-
41+
---
4242

4343
### Database Access Controls
4444

4545
Read Operations
46-
query_connx allows SELECT statements only
47-
Multi-statement execution is blocked
48-
Semicolons are rejected to prevent batching
49-
Queries must produce a result set
46+
* query_connx allows SELECT statements only
47+
* Multi-statement execution is blocked
48+
* Semicolons are rejected to prevent batching
49+
* Queries must produce a result set
5050

5151
Write Operations
52-
Writes are disabled by default
53-
Enabling writes requires:
52+
* Writes are disabled by default
53+
* Enabling writes requires:
5454

5555
CONNX_ALLOW_WRITES=true
5656

5757

58-
Only INSERT, UPDATE, and DELETE operations are permitted
59-
Single-statement enforcement applies to all write queries
58+
* Only INSERT, UPDATE, and DELETE operations are permitted
59+
* Single-statement enforcement applies to all write queries
6060

61-
61+
---
6262

6363
SQL Injection Protection
6464

6565
This project does not rely on regex-based SQL sanitization.
6666

6767
Instead, it enforces safety using:
68-
Parameterized queries for user-supplied values
69-
Strict query classification (SELECT vs non-SELECT)
70-
Single-statement enforcement
71-
Purpose-built tools (e.g., find_customers) instead of raw SQL
68+
* Parameterized queries for user-supplied values
69+
* Strict query classification (SELECT vs non-SELECT)
70+
* Single-statement enforcement
71+
* Purpose-built tools (e.g., find_customers) instead of raw SQL
7272

7373
Regex sanitization is intentionally avoided, as it is brittle and unsafe when used as a primary defense mechanism.
7474

75-
75+
---
7676

7777
Logging & Observability
78-
SQL text is never logged
79-
Each query is logged using a hashed fingerprint
80-
Logs include:
81-
Operation type
82-
Row count (where applicable)
83-
Error metadata (no sensitive data)
78+
* SQL text is never logged
79+
* Each query is logged using a hashed fingerprint
80+
* Logs include:
81+
* - Operation type
82+
* - Row count (where applicable)
83+
* - Error metadata (no sensitive data)
8484

8585
Example:
8686

8787
Query OK fp=3a1c9f82a2d1 rows=42
8888

8989

90-
90+
---
9191

9292
MCP Host Trust Boundary
9393

9494
This MCP server trusts the MCP host to:
95-
Obtain user consent before invoking tools
96-
Restrict which MCP servers are available
97-
Manage user authentication and authorization
95+
* Obtain user consent before invoking tools
96+
* Restrict which MCP servers are available
97+
* Manage user authentication and authorization
9898

9999
The server itself does not implement:
100-
User authentication
101-
Role-based access control
102-
Rate limiting
100+
* User authentication
101+
* Role-based access control
102+
* Rate limiting
103103

104104
These must be handled by the MCP host or surrounding infrastructure.
105105

106-
106+
---
107107

108108
Network Security
109109

110110
Recommendations for production deployments:
111-
Run the MCP server on the same host as the MCP client when possible
112-
Use VPNs or private networks for database access
113-
Restrict outbound connectivity using firewall rules
114-
Ensure CONNX endpoints are not publicly accessible
111+
* Run the MCP server on the same host as the MCP client when possible
112+
* Use VPNs or private networks for database access
113+
* Restrict outbound connectivity using firewall rules
114+
* Ensure CONNX endpoints are not publicly accessible
115115

116-
116+
---
117117

118118
Denial of Service Considerations
119119

120120
This reference implementation does not include:
121-
Rate limiting
122-
Query cost estimation
123-
Timeout enforcement per query
121+
* Rate limiting
122+
* Query cost estimation
123+
* Timeout enforcement per query
124124

125125
For production use, consider:
126-
Query execution timeouts
127-
Result row limits
128-
MCP host-level rate controls
126+
* Query execution timeouts
127+
* Result row limits
128+
* MCP host-level rate controls
129129

130-
130+
---
131131

132132
Vulnerability Reporting
133133

134134
If you discover a security issue:
135-
1. Do not open a public GitHub issue
136-
2. Contact the repository maintainer directly
137-
3. Provide:
138-
Description of the issue
139-
Steps to reproduce
140-
Potential impact
135+
* Do not open a public GitHub issue
136+
* Contact the repository maintainer directly
137+
* Provide:
138+
* - Description of the issue
139+
* - Steps to reproduce
140+
* - Potential impact
141141

142142
Reported issues will be reviewed and addressed on a best-effort basis.
143143

144-
144+
---
145145

146146
Disclaimer
147147

148148
This project is provided as-is, without warranty of any kind.
149149

150150
It is intended as:
151-
A learning resource
152-
A reference implementation
153-
A starting point for secure MCP server development
151+
* A learning resource
152+
* A reference implementation
153+
* A starting point for secure MCP server development
154154

155155
It is not intended to replace enterprise-grade security controls.
156156

157-
157+
---
158158

159159
Recommended Next Steps
160160

161161
For teams building on this example:
162-
Add authentication and authorization
163-
Implement rate limiting
164-
Introduce query whitelisting
165-
Integrate audit logging
166-
Perform a security review before production use
162+
* Add authentication and authorization
163+
* Implement rate limiting
164+
* Introduce query whitelisting
165+
* Integrate audit logging
166+
* Perform a security review before production use

0 commit comments

Comments
 (0)