vibenorma-mcp 1.0.0

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.
Files changed (3) hide show
  1. package/README.md +74 -0
  2. package/index.js +143 -0
  3. package/package.json +19 -0
package/README.md ADDED
@@ -0,0 +1,74 @@
1
+ # VibeNORMA MCP Server
2
+
3
+ **Chilean Legal AI Agent — 97 laws, decrees, and regulations integrated**
4
+
5
+ An MCP (Model Context Protocol) server that gives your AI assistant access to the complete Chilean legal database including:
6
+
7
+ - **Ley 21.719** — Protección de Datos Personales
8
+ - **Código Civil** — Derecho civil chileno
9
+ - **Código Penal** — Derecho penal chileno
10
+ - **Código de Comercio** — Derecho comercial
11
+ - **Código del Trabajo** — Legislación laboral
12
+ - **Código Orgánico de Tribunales** — Organización judicial
13
+ - **Ley 21.459** — Delitos Informáticos
14
+ - **60+ decretos, DFLs y resoluciones** — Normativa actualizada
15
+
16
+ ## Install
17
+
18
+ ```bash
19
+ npm install vibenos-mcp
20
+ ```
21
+
22
+ ## Usage with Claude Desktop
23
+
24
+ Add to your `claude_desktop_config.json`:
25
+
26
+ ```json
27
+ {
28
+ "mcpServers": {
29
+ "vibenos-legal": {
30
+ "command": "npx",
31
+ "args": ["vibenos-mcp"]
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ ## Tools
38
+
39
+ ### `ask_chilean_law`
40
+ Ask any question about Chilean law. The agent searches through 36+ laws and provides cited answers.
41
+
42
+ ```
43
+ ask_chilean_law(question="¿Qué dice la Ley 21.719 sobre derechos ARCO?")
44
+ ```
45
+
46
+ ### `search_chilean_laws`
47
+ Search laws by keyword. Returns matching laws with excerpts.
48
+
49
+ ```
50
+ search_chilean_laws(query="proteccion datos")
51
+ ```
52
+
53
+ ### `list_chilean_laws`
54
+ List all available laws in the database.
55
+
56
+ ### `ley_21719_summary`
57
+ Get a comprehensive summary of Ley 21.719 (Chilean Data Protection Law).
58
+
59
+ ### `check_compliance`
60
+ Check if a company's data processing practices comply with Ley 21.719.
61
+
62
+ ```
63
+ check_compliance(practices="We collect RUT, email, and phone numbers for marketing without explicit consent")
64
+ ```
65
+
66
+ ## Environment Variables
67
+
68
+ ```bash
69
+ VIBENOS_API_URL=https://vibenos-api-production.up.railway.app # Backend API (default)
70
+ ```
71
+
72
+ ## License
73
+
74
+ Apache 2.0 — VibeCodingChile SpA
package/index.js ADDED
@@ -0,0 +1,143 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import { z } from "zod";
6
+
7
+ const API_URL = process.env.VIBENOS_API_URL || "https://vibenos-api-production.up.railway.app";
8
+
9
+ const server = new McpServer({
10
+ name: "vibenos-legal-agent",
11
+ version: "1.0.0",
12
+ });
13
+
14
+ // Tool: Ask a legal question about Chilean law
15
+ server.tool(
16
+ "ask_chilean_law",
17
+ "Ask a question about Chilean law. The agent searches through 36+ laws and regulations including Ley 21.719 (data protection), Código Civil, Código Tributario, and more.",
18
+ {
19
+ question: z.string().describe("The legal question in natural language (Spanish preferred)"),
20
+ },
21
+ async ({ question }) => {
22
+ try {
23
+ const res = await fetch(`${API_URL}/api/chat`, {
24
+ method: "POST",
25
+ headers: { "Content-Type": "application/json" },
26
+ body: JSON.stringify({ message: question }),
27
+ });
28
+ const data = await res.json();
29
+ return {
30
+ content: [{ type: "text", text: data.reply || data.error }],
31
+ };
32
+ } catch (err) {
33
+ return {
34
+ content: [{ type: "text", text: `Error: ${err.message}` }],
35
+ };
36
+ }
37
+ }
38
+ );
39
+
40
+ // Tool: Search Chilean laws by keyword
41
+ server.tool(
42
+ "search_chilean_laws",
43
+ "Search through 36+ Chilean laws and regulations by keyword. Returns matching laws with excerpts.",
44
+ {
45
+ query: z.string().describe("Search keyword (e.g., 'proteccion datos', 'tributario', 'laboral')"),
46
+ },
47
+ async ({ query }) => {
48
+ try {
49
+ const res = await fetch(`${API_URL}/api/search?q=${encodeURIComponent(query)}`);
50
+ const data = await res.json();
51
+ const text = data.length
52
+ ? data.map((l) => `**${l.name}**\n${l.excerpt}`).join("\n\n")
53
+ : "No laws found matching that query.";
54
+ return {
55
+ content: [{ type: "text", text }],
56
+ };
57
+ } catch (err) {
58
+ return {
59
+ content: [{ type: "text", text: `Error: ${err.message}` }],
60
+ };
61
+ }
62
+ }
63
+ );
64
+
65
+ // Tool: List all available Chilean laws
66
+ server.tool(
67
+ "list_chilean_laws",
68
+ "List all 36+ Chilean laws and regulations available in the database.",
69
+ {},
70
+ async () => {
71
+ try {
72
+ const res = await fetch(`${API_URL}/api/laws`);
73
+ const data = await res.json();
74
+ const text = data.map((l) => `- **${l.name}** (${l.pages} pages) — ${l.file}`).join("\n");
75
+ return {
76
+ content: [{ type: "text", text: `📚 Available laws:\n\n${text}` }],
77
+ };
78
+ } catch (err) {
79
+ return {
80
+ content: [{ type: "text", text: `Error: ${err.message}` }],
81
+ };
82
+ }
83
+ }
84
+ );
85
+
86
+ // Tool: Get Ley 21.719 summary (most requested)
87
+ server.tool(
88
+ "ley_21719_summary",
89
+ "Get a summary of Ley 21.719 (Chilean Data Protection Law) including key articles, rights, and obligations.",
90
+ {},
91
+ async () => {
92
+ try {
93
+ const res = await fetch(`${API_URL}/api/chat`, {
94
+ method: "POST",
95
+ headers: { "Content-Type": "application/json" },
96
+ body: JSON.stringify({
97
+ message: "Dame un resumen completo de la Ley 21.719 de Proteccion de Datos Personales de Chile, incluyendo derechos ARCO, obligaciones del responsable, y sanciones.",
98
+ }),
99
+ });
100
+ const data = await res.json();
101
+ return {
102
+ content: [{ type: "text", text: data.reply }],
103
+ };
104
+ } catch (err) {
105
+ return {
106
+ content: [{ type: "text", text: `Error: ${err.message}` }],
107
+ };
108
+ }
109
+ }
110
+ );
111
+
112
+ // Tool: Check compliance status
113
+ server.tool(
114
+ "check_compliance",
115
+ "Check if a company's data processing practices comply with Ley 21.719. Describe the practices and get a compliance assessment.",
116
+ {
117
+ practices: z.string().describe("Description of the company's data processing practices"),
118
+ },
119
+ async ({ practices }) => {
120
+ try {
121
+ const res = await fetch(`${API_URL}/api/chat`, {
122
+ method: "POST",
123
+ headers: { "Content-Type": "application/json" },
124
+ body: JSON.stringify({
125
+ message: `Evalua si las siguientes practicas de tratamiento de datos cumplen con la Ley 21.719 de Chile: "${practices}". Identifica brechas de cumplimiento y recomienda acciones correctivas.`,
126
+ }),
127
+ });
128
+ const data = await res.json();
129
+ return {
130
+ content: [{ type: "text", text: data.reply }],
131
+ };
132
+ } catch (err) {
133
+ return {
134
+ content: [{ type: "text", text: `Error: ${err.message}` }],
135
+ };
136
+ }
137
+ }
138
+ );
139
+
140
+ // Start MCP server
141
+ const transport = new StdioServerTransport();
142
+ await server.connect(transport);
143
+ console.error("🚀 VibeNORMA MCP Server running");
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "vibenorma-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for Chilean legal AI — 97 laws, Ley 21.719, Código Civil, Código Penal, Código del Trabajo",
5
+ "type": "module",
6
+ "bin": {
7
+ "vibenorma-mcp": "./index.js"
8
+ },
9
+ "keywords": ["mcp", "chilean-law", "legal-ai", "ley-21719", "data-protection", "compliance"],
10
+ "author": "VibeCodingChile SpA",
11
+ "license": "Apache-2.0",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/CodexPromptusIuris/vibenos"
15
+ },
16
+ "dependencies": {
17
+ "@modelcontextprotocol/sdk": "^1.12.1"
18
+ }
19
+ }