Skip to content

Commit 91f5afd

Browse files
ajitpratap0Ajit Pratap Singhclaude
authored
feat: MCP safety annotations + privacy policy for directory submissions (#387)
* feat(website): add privacy policy page for Anthropic MCP directory submission Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(mcp): add safety annotations to all 7 tools for Anthropic directory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini-2655.local> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 41b2ff3 commit 91f5afd

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed

pkg/mcp/server.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ func (s *Server) registerTools() {
8484
s.mcpSrv.AddTool(
8585
mcp.NewTool("validate_sql",
8686
mcp.WithDescription("Validate SQL syntax. Returns {valid: bool, error?: string, dialect?: string}."),
87+
mcp.WithReadOnlyHintAnnotation(true),
88+
mcp.WithDestructiveHintAnnotation(false),
89+
mcp.WithIdempotentHintAnnotation(true),
90+
mcp.WithOpenWorldHintAnnotation(false),
8791
mcp.WithString("sql",
8892
mcp.Required(),
8993
mcp.Description("The SQL string to validate"),
@@ -100,6 +104,10 @@ func (s *Server) registerTools() {
100104
s.mcpSrv.AddTool(
101105
mcp.NewTool("format_sql",
102106
mcp.WithDescription("Format SQL with configurable indentation and keyword casing."),
107+
mcp.WithReadOnlyHintAnnotation(true),
108+
mcp.WithDestructiveHintAnnotation(false),
109+
mcp.WithIdempotentHintAnnotation(true),
110+
mcp.WithOpenWorldHintAnnotation(false),
103111
mcp.WithString("sql",
104112
mcp.Required(),
105113
mcp.Description("The SQL string to format"),
@@ -121,6 +129,10 @@ func (s *Server) registerTools() {
121129
s.mcpSrv.AddTool(
122130
mcp.NewTool("parse_sql",
123131
mcp.WithDescription("Parse SQL and return an AST summary: statement count and types."),
132+
mcp.WithReadOnlyHintAnnotation(true),
133+
mcp.WithDestructiveHintAnnotation(false),
134+
mcp.WithIdempotentHintAnnotation(true),
135+
mcp.WithOpenWorldHintAnnotation(false),
124136
mcp.WithString("sql",
125137
mcp.Required(),
126138
mcp.Description("The SQL string to parse"),
@@ -133,6 +145,10 @@ func (s *Server) registerTools() {
133145
s.mcpSrv.AddTool(
134146
mcp.NewTool("extract_metadata",
135147
mcp.WithDescription("Extract tables, columns, and functions referenced in SQL."),
148+
mcp.WithReadOnlyHintAnnotation(true),
149+
mcp.WithDestructiveHintAnnotation(false),
150+
mcp.WithIdempotentHintAnnotation(true),
151+
mcp.WithOpenWorldHintAnnotation(false),
136152
mcp.WithString("sql",
137153
mcp.Required(),
138154
mcp.Description("The SQL string to analyze"),
@@ -145,6 +161,10 @@ func (s *Server) registerTools() {
145161
s.mcpSrv.AddTool(
146162
mcp.NewTool("security_scan",
147163
mcp.WithDescription("Scan SQL for injection patterns: tautologies, UNION attacks, stacked queries, comment bypasses, and more."),
164+
mcp.WithReadOnlyHintAnnotation(true),
165+
mcp.WithDestructiveHintAnnotation(false),
166+
mcp.WithIdempotentHintAnnotation(true),
167+
mcp.WithOpenWorldHintAnnotation(false),
148168
mcp.WithString("sql",
149169
mcp.Required(),
150170
mcp.Description("The SQL string to scan"),
@@ -157,6 +177,10 @@ func (s *Server) registerTools() {
157177
s.mcpSrv.AddTool(
158178
mcp.NewTool("lint_sql",
159179
mcp.WithDescription("Lint SQL against all 10 GoSQLX style rules (L001–L010)."),
180+
mcp.WithReadOnlyHintAnnotation(true),
181+
mcp.WithDestructiveHintAnnotation(false),
182+
mcp.WithIdempotentHintAnnotation(true),
183+
mcp.WithOpenWorldHintAnnotation(false),
160184
mcp.WithString("sql",
161185
mcp.Required(),
162186
mcp.Description("The SQL string to lint"),
@@ -169,6 +193,10 @@ func (s *Server) registerTools() {
169193
s.mcpSrv.AddTool(
170194
mcp.NewTool("analyze_sql",
171195
mcp.WithDescription("Run all 6 analysis tools concurrently and return a composite report (validate, parse, metadata, security, lint, format)."),
196+
mcp.WithReadOnlyHintAnnotation(true),
197+
mcp.WithDestructiveHintAnnotation(false),
198+
mcp.WithIdempotentHintAnnotation(true),
199+
mcp.WithOpenWorldHintAnnotation(false),
172200
mcp.WithString("sql",
173201
mcp.Required(),
174202
mcp.Description("The SQL string to analyze"),

website/src/components/Footer.astro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const columns = [
1414
{ label: 'Docs', href: '/docs/' },
1515
{ label: 'Getting Started', href: '/docs/getting_started/' },
1616
{ label: 'API Reference', href: '/docs/api_reference/' },
17+
{ label: 'Privacy', href: '/privacy/' },
1718
],
1819
},
1920
{

website/src/pages/privacy.astro

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
import BaseLayout from '../layouts/BaseLayout.astro';
3+
---
4+
<BaseLayout title="Privacy Policy - GoSQLX" description="GoSQLX privacy policy. We respect your privacy and collect no personal data.">
5+
<main class="container mx-auto px-4 py-16 max-w-3xl">
6+
<h1 class="text-3xl font-bold text-white mb-8">Privacy Policy</h1>
7+
<div class="prose prose-invert prose-slate max-w-none space-y-8">
8+
9+
<section>
10+
<h2 class="text-xl font-semibold text-white mb-3">Overview</h2>
11+
<p class="text-slate-300 leading-relaxed">
12+
GoSQLX is an open-source SQL parsing SDK for Go, licensed under Apache 2.0.
13+
We respect your privacy. This policy explains what data is (and is not) collected
14+
across GoSQLX services.
15+
</p>
16+
</section>
17+
18+
<section>
19+
<h2 class="text-xl font-semibold text-white mb-3">Website (gosqlx.dev)</h2>
20+
<p class="text-slate-300 leading-relaxed">
21+
This website is a static site hosted on GitHub Pages. We do not use analytics,
22+
tracking scripts, or cookies. No personal data is collected by us when you visit
23+
this site. GitHub Pages may collect basic server logs as described in
24+
<a href="https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement" target="_blank" rel="noopener noreferrer" class="text-orange-400 hover:text-orange-300 underline">GitHub's Privacy Statement</a>.
25+
</p>
26+
</section>
27+
28+
<section>
29+
<h2 class="text-xl font-semibold text-white mb-3">WASM Playground</h2>
30+
<p class="text-slate-300 leading-relaxed">
31+
The interactive SQL playground at <a href="/playground/" class="text-orange-400 hover:text-orange-300 underline">/playground/</a>
32+
runs entirely in your browser via WebAssembly. Your SQL queries are parsed locally
33+
and are never sent to any server.
34+
</p>
35+
</section>
36+
37+
<section>
38+
<h2 class="text-xl font-semibold text-white mb-3">Remote MCP Server (mcp.gosqlx.dev)</h2>
39+
<p class="text-slate-300 leading-relaxed">
40+
The GoSQLX MCP server is stateless. SQL queries sent to the server are processed
41+
and immediately discarded &mdash; they are not logged or stored. No authentication
42+
or user accounts are required. The server uses in-memory IP-based rate limiting;
43+
IP addresses are held only in memory and cleared after 10 minutes of inactivity.
44+
They are never written to disk or shared with third parties.
45+
</p>
46+
</section>
47+
48+
<section>
49+
<h2 class="text-xl font-semibold text-white mb-3">VS Code Extension</h2>
50+
<p class="text-slate-300 leading-relaxed">
51+
The GoSQLX VS Code extension runs locally on your machine. It does not send
52+
telemetry, analytics, or any data to GoSQLX servers.
53+
</p>
54+
</section>
55+
56+
<section>
57+
<h2 class="text-xl font-semibold text-white mb-3">Third-Party Services</h2>
58+
<p class="text-slate-300 leading-relaxed">
59+
GoSQLX relies on the following third-party services, each with their own privacy policies:
60+
</p>
61+
<ul class="list-disc list-inside text-slate-300 mt-2 space-y-1">
62+
<li>
63+
<a href="https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement" target="_blank" rel="noopener noreferrer" class="text-orange-400 hover:text-orange-300 underline">GitHub</a>
64+
&mdash; website hosting (GitHub Pages) and source code hosting
65+
</li>
66+
<li>
67+
<a href="https://render.com/privacy" target="_blank" rel="noopener noreferrer" class="text-orange-400 hover:text-orange-300 underline">Render</a>
68+
&mdash; MCP server hosting
69+
</li>
70+
</ul>
71+
</section>
72+
73+
<section>
74+
<h2 class="text-xl font-semibold text-white mb-3">Open Source</h2>
75+
<p class="text-slate-300 leading-relaxed">
76+
All GoSQLX code is open source under the
77+
<a href="https://github.com/ajitpratap0/GoSQLX/blob/main/LICENSE" target="_blank" rel="noopener noreferrer" class="text-orange-400 hover:text-orange-300 underline">Apache 2.0 license</a>.
78+
You can verify any claim in this policy by reviewing the
79+
<a href="https://github.com/ajitpratap0/GoSQLX" target="_blank" rel="noopener noreferrer" class="text-orange-400 hover:text-orange-300 underline">source code on GitHub</a>.
80+
</p>
81+
</section>
82+
83+
<section>
84+
<h2 class="text-xl font-semibold text-white mb-3">Contact</h2>
85+
<p class="text-slate-300 leading-relaxed">
86+
If you have questions about this privacy policy, please open an issue on
87+
<a href="https://github.com/ajitpratap0/GoSQLX/issues" target="_blank" rel="noopener noreferrer" class="text-orange-400 hover:text-orange-300 underline">GitHub Issues</a>.
88+
</p>
89+
</section>
90+
91+
<p class="text-slate-500 text-sm pt-4 border-t border-elevated">
92+
Last updated: March 15, 2026
93+
</p>
94+
</div>
95+
</main>
96+
</BaseLayout>

0 commit comments

Comments
 (0)