@mifactory-bot/contratos-mcp 1.0.0 → 1.0.3

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.
@@ -0,0 +1 @@
1
+ ghu_Ox1sriMmupA5uVf0AY5LOPYCaQLa1H1CiIeF
@@ -0,0 +1 @@
1
+ {"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3NzI1MDE3ODUsIm5iZiI6MTc3MjUwMTQ4NSwiaWF0IjoxNzcyNTAxNDg1LCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6Im1pZmFjdG9yeS1ib3QiLCJwZXJtaXNzaW9ucyI6W3siYWN0aW9uIjoicHVibGlzaCIsInJlc291cmNlIjoiaW8uZ2l0aHViLm1pZmFjdG9yeS1ib3QvKiJ9XX0.PUd8WPS0qAbRfZO2-MMsHAb2e4VYNzn0iX97NXzayCO1uucbzFxkDgH3cDZEx7Il-vFY_67eBGm9k7Bp5z9FAA","expires_at":1772501785}
@@ -1 +1 @@
1
- 1772498025.5634007
1
+ 1772503051.2433093
@@ -7,19 +7,27 @@ export default async function handler(req, res) {
7
7
  if (req.method !== 'POST') {
8
8
  return res.status(405).json({ error: 'Método no permitido' });
9
9
  }
10
+
10
11
  const { contract_text, payment_method_id } = req.body;
11
12
  if (!contract_text || !payment_method_id) {
12
13
  return res.status(400).json({ error: 'Parámetros contract_text y payment_method_id requeridos' });
13
14
  }
15
+
14
16
  try {
17
+ // Crear PaymentIntent y confirmar pago 100% API
15
18
  const paymentIntent = await stripe.paymentIntents.create({
16
- amount: 1000,
19
+ amount: 1000, // monto en centavos, ajustar según contrato
17
20
  currency: 'usd',
18
21
  payment_method: payment_method_id,
19
22
  confirm: true
20
23
  });
24
+
25
+ // Generar PDF
21
26
  const pdfBuffer = await createContractPDF(contract_text);
27
+
28
+ // Enviar PDF base64
22
29
  const pdfBase64 = pdfBuffer.toString('base64');
30
+
23
31
  res.status(200).json({ pdf: pdfBase64, paymentIntentId: paymentIntent.id });
24
32
  } catch (error) {
25
33
  res.status(500).json({ error: error.message });
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@mifactory-bot/contratos-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "main": "index.js",
5
- "mcpName": "io.github.mifactory-bot/contratos",
5
+ "mcpName": "io.github.mifactory-bot/mifactory-contratos",
6
6
  "scripts": {
7
7
  "start": "node index.js"
8
8
  },
@@ -23,5 +23,10 @@
23
23
  "url": "https://github.com/mifactory-bot/mifactory-contratos/issues"
24
24
  },
25
25
  "homepage": "https://github.com/mifactory-bot/mifactory-contratos#readme",
26
- "keywords": ["mcp", "contracts", "legal", "stripe"]
26
+ "keywords": [
27
+ "mcp",
28
+ "contracts",
29
+ "legal",
30
+ "stripe"
31
+ ]
27
32
  }
@@ -11,7 +11,7 @@ TELEGRAM_BOT_TOKEN = os.getenv('TELEGRAM_BOT_TOKEN')
11
11
  TELEGRAM_CHAT_ID = '7277427829'
12
12
 
13
13
  # Setup Stripe
14
- stripe.api_key = "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"
14
+ stripe.api_key = "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"
15
15
  TELEGRAM_BOT_TOKEN = "8626556110:AAHMVF6KDv_jnprmKhQVnba9W54Ie2kgjf8"
16
16
 
17
17
  if not stripe.api_key:
package/server.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.mifactory-bot/mifactory-contratos",
4
+ "description": "MCP Server para generar y comprar contratos freelance",
5
+ "repository": {
6
+ "url": "https://github.com/mifactory-bot/mifactory-contratos",
7
+ "source": "github"
8
+ },
9
+ "version": "1.0.2",
10
+ "packages": [
11
+ {
12
+ "registryType": "npm",
13
+ "identifier": "@mifactory-bot/contratos-mcp",
14
+ "version": "1.0.2",
15
+ "transport": {
16
+ "type": "streamable-http",
17
+ "url": "https://freelance-contratos.vercel.app/api/mcp"
18
+ },
19
+ "environmentVariables": [
20
+ {
21
+ "description": "Stripe secret key for payment processing",
22
+ "isRequired": true,
23
+ "format": "string",
24
+ "isSecret": true,
25
+ "name": "STRIPE_SECRET_KEY"
26
+ }
27
+ ]
28
+ }
29
+ ],
30
+ "endpoints": [
31
+ {
32
+ "path": "/api/mcp",
33
+ "method": "GET",
34
+ "description": "Devuelve la descripción MCP del servidor"
35
+ },
36
+ {
37
+ "path": "/api/generate_contract",
38
+ "method": "POST",
39
+ "description": "Genera un contrato basado en tipo y datos del cliente"
40
+ },
41
+ {
42
+ "path": "/api/purchase_contract",
43
+ "method": "POST",
44
+ "description": "Acepta pagos programáticos vía Stripe y devuelve el PDF del contrato en base64"
45
+ }
46
+ ]
47
+ }