@jaypie/mcp 0.2.4 → 0.2.5

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.
package/dist/index.js CHANGED
@@ -885,7 +885,7 @@ function listLlmProviders() {
885
885
  };
886
886
  }
887
887
 
888
- const BUILD_VERSION_STRING = "@jaypie/mcp@0.2.4#16b1294c"
888
+ const BUILD_VERSION_STRING = "@jaypie/mcp@0.2.5#b58bafc3"
889
889
  ;
890
890
  const __filename$1 = fileURLToPath(import.meta.url);
891
891
  const __dirname$1 = path.dirname(__filename$1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jaypie/mcp",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Jaypie MCP",
5
5
  "repository": {
6
6
  "type": "git",
@@ -545,3 +545,118 @@ const { items: all } = await queryByOu({
545
545
  // Permanent deletion (use sparingly)
546
546
  await destroyEntity({ id: "123", model: "record" });
547
547
  ```
548
+
549
+ ## MCP Integration
550
+
551
+ The package provides MCP (Model Context Protocol) tools via `@jaypie/dynamodb/mcp` subpath export.
552
+
553
+ ### Installation
554
+
555
+ ```bash
556
+ npm install @jaypie/dynamodb @modelcontextprotocol/sdk
557
+ ```
558
+
559
+ ### Environment Variables
560
+
561
+ | Variable | Required | Default | Description |
562
+ |----------|----------|---------|-------------|
563
+ | `DYNAMODB_TABLE_NAME` | Yes | - | Table name for operations |
564
+ | `DYNAMODB_ENDPOINT` | No | - | Local endpoint (e.g., `http://127.0.0.1:8000`) |
565
+ | `AWS_REGION` | No | `us-east-1` | AWS region |
566
+ | `PROJECT_NAME` | No | `jaypie` | Container name prefix for docker-compose |
567
+
568
+ ### Register MCP Tools
569
+
570
+ ```typescript
571
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
572
+ import { registerDynamoDbTools } from "@jaypie/dynamodb/mcp";
573
+
574
+ const server = new McpServer({ name: "my-server", version: "1.0.0" });
575
+
576
+ const { tools } = registerDynamoDbTools({ server });
577
+ // tools: ["dynamodb_get", "dynamodb_put", "dynamodb_update", ...]
578
+ ```
579
+
580
+ ### Available MCP Tools
581
+
582
+ #### Entity Operations
583
+ | Tool | Description |
584
+ |------|-------------|
585
+ | `dynamodb_get` | Get entity by id and model |
586
+ | `dynamodb_put` | Create or replace an entity |
587
+ | `dynamodb_update` | Update entity fields |
588
+ | `dynamodb_delete` | Soft delete (sets deletedAt) |
589
+ | `dynamodb_archive` | Archive entity (sets archivedAt) |
590
+ | `dynamodb_destroy` | Hard delete (permanent) |
591
+
592
+ #### Query Operations
593
+ | Tool | Description |
594
+ |------|-------------|
595
+ | `dynamodb_query_ou` | Query by organizational unit |
596
+ | `dynamodb_query_alias` | Query by human-friendly alias |
597
+ | `dynamodb_query_class` | Query by category classification |
598
+ | `dynamodb_query_type` | Query by type classification |
599
+ | `dynamodb_query_xid` | Query by external ID |
600
+
601
+ #### Admin Operations (Enabled by Default)
602
+ | Tool | Description |
603
+ |------|-------------|
604
+ | `dynamodb_status` | Check DynamoDB connection status |
605
+ | `dynamodb_create_table` | Create table with Jaypie GSI schema |
606
+ | `dynamodb_generate_docker_compose` | Generate docker-compose.yml for local dev |
607
+
608
+ ### Disable Admin Tools
609
+
610
+ ```typescript
611
+ const { tools } = registerDynamoDbTools({
612
+ server,
613
+ includeAdmin: false, // Exclude admin tools
614
+ });
615
+ ```
616
+
617
+ ### Auto-Initialization
618
+
619
+ MCP tools auto-initialize the DynamoDB client from environment variables. Manual `initClient()` is not required when using MCP tools.
620
+
621
+ ### Local Development with MCP
622
+
623
+ Generate docker-compose and create table:
624
+
625
+ ```typescript
626
+ // Use dynamodb_generate_docker_compose tool to get:
627
+ // - docker-compose.yml content
628
+ // - Environment variables (.env format)
629
+
630
+ // Start local DynamoDB
631
+ // docker compose up -d
632
+
633
+ // Use dynamodb_create_table tool to create table with full GSI schema
634
+ ```
635
+
636
+ ### Example MCP Tool Usage
637
+
638
+ ```json
639
+ // dynamodb_put
640
+ {
641
+ "id": "abc-123",
642
+ "model": "record",
643
+ "name": "My Record",
644
+ "ou": "@",
645
+ "alias": "my-record",
646
+ "class": "memory"
647
+ }
648
+
649
+ // dynamodb_query_ou
650
+ {
651
+ "model": "record",
652
+ "ou": "@",
653
+ "limit": 10
654
+ }
655
+
656
+ // dynamodb_update
657
+ {
658
+ "id": "abc-123",
659
+ "model": "record",
660
+ "name": "Updated Name"
661
+ }
662
+ ```