@kozou/mcp 0.0.1 → 0.1.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 (71) hide show
  1. package/LICENSE +202 -0
  2. package/dist/cli.d.ts +3 -0
  3. package/dist/cli.d.ts.map +1 -0
  4. package/dist/cli.js +30 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/index.d.ts +16 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +19 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/schemaCache.d.ts +18 -0
  11. package/dist/schemaCache.d.ts.map +1 -0
  12. package/dist/schemaCache.js +43 -0
  13. package/dist/schemaCache.js.map +1 -0
  14. package/dist/schemas/describe_table.d.ts +198 -0
  15. package/dist/schemas/describe_table.d.ts.map +1 -0
  16. package/dist/schemas/describe_table.js +41 -0
  17. package/dist/schemas/describe_table.js.map +1 -0
  18. package/dist/schemas/describe_view.d.ts +107 -0
  19. package/dist/schemas/describe_view.d.ts.map +1 -0
  20. package/dist/schemas/describe_view.js +30 -0
  21. package/dist/schemas/describe_view.js.map +1 -0
  22. package/dist/schemas/get_concept_context.d.ts +74 -0
  23. package/dist/schemas/get_concept_context.d.ts.map +1 -0
  24. package/dist/schemas/get_concept_context.js +24 -0
  25. package/dist/schemas/get_concept_context.js.map +1 -0
  26. package/dist/schemas/list_concepts.d.ts +37 -0
  27. package/dist/schemas/list_concepts.d.ts.map +1 -0
  28. package/dist/schemas/list_concepts.js +11 -0
  29. package/dist/schemas/list_concepts.js.map +1 -0
  30. package/dist/schemas/list_tables.d.ts +46 -0
  31. package/dist/schemas/list_tables.d.ts.map +1 -0
  32. package/dist/schemas/list_tables.js +14 -0
  33. package/dist/schemas/list_tables.js.map +1 -0
  34. package/dist/schemas/list_views.d.ts +38 -0
  35. package/dist/schemas/list_views.d.ts.map +1 -0
  36. package/dist/schemas/list_views.js +12 -0
  37. package/dist/schemas/list_views.js.map +1 -0
  38. package/dist/server.d.ts +4 -0
  39. package/dist/server.d.ts.map +1 -0
  40. package/dist/server.js +105 -0
  41. package/dist/server.js.map +1 -0
  42. package/dist/startStdioServer.d.ts +14 -0
  43. package/dist/startStdioServer.d.ts.map +1 -0
  44. package/dist/startStdioServer.js +25 -0
  45. package/dist/startStdioServer.js.map +1 -0
  46. package/dist/tools/describe_table.d.ts +4 -0
  47. package/dist/tools/describe_table.d.ts.map +1 -0
  48. package/dist/tools/describe_table.js +45 -0
  49. package/dist/tools/describe_table.js.map +1 -0
  50. package/dist/tools/describe_view.d.ts +4 -0
  51. package/dist/tools/describe_view.d.ts.map +1 -0
  52. package/dist/tools/describe_view.js +28 -0
  53. package/dist/tools/describe_view.js.map +1 -0
  54. package/dist/tools/get_concept_context.d.ts +4 -0
  55. package/dist/tools/get_concept_context.d.ts.map +1 -0
  56. package/dist/tools/get_concept_context.js +25 -0
  57. package/dist/tools/get_concept_context.js.map +1 -0
  58. package/dist/tools/list_concepts.d.ts +4 -0
  59. package/dist/tools/list_concepts.d.ts.map +1 -0
  60. package/dist/tools/list_concepts.js +13 -0
  61. package/dist/tools/list_concepts.js.map +1 -0
  62. package/dist/tools/list_tables.d.ts +4 -0
  63. package/dist/tools/list_tables.d.ts.map +1 -0
  64. package/dist/tools/list_tables.js +16 -0
  65. package/dist/tools/list_tables.js.map +1 -0
  66. package/dist/tools/list_views.d.ts +4 -0
  67. package/dist/tools/list_views.d.ts.map +1 -0
  68. package/dist/tools/list_views.js +15 -0
  69. package/dist/tools/list_views.js.map +1 -0
  70. package/package.json +48 -4
  71. package/README.md +0 -3
@@ -0,0 +1,45 @@
1
+ import { describeTableInputSchema, } from '../schemas/describe_table.js';
2
+ export function describeTable(input, ctx) {
3
+ const parsed = describeTableInputSchema.parse(input);
4
+ const table = ctx.tables.find((t) => t.qualifiedName === parsed.qualifiedName);
5
+ if (!table) {
6
+ throw new Error(`Table not found: ${parsed.qualifiedName}`);
7
+ }
8
+ const referencesByField = new Map();
9
+ for (const rel of table.relations) {
10
+ referencesByField.set(rel.field, {
11
+ table: `${rel.references.schema}.${rel.references.table}`,
12
+ column: rel.references.column,
13
+ });
14
+ }
15
+ const columns = table.columns.map((c) => ({
16
+ name: c.name,
17
+ dataType: c.dataType,
18
+ nullable: c.nullable,
19
+ defaultExpr: c.defaultExpr,
20
+ description: c.description,
21
+ aiDescription: c.aiDescription,
22
+ enumValues: c.enumValues,
23
+ isForeignKey: c.isForeignKey,
24
+ references: referencesByField.get(c.name) ?? null,
25
+ }));
26
+ return {
27
+ qualifiedName: table.qualifiedName,
28
+ label: table.label,
29
+ description: table.description,
30
+ aiDescription: table.aiDescription,
31
+ primaryKey: table.primaryKey,
32
+ columns,
33
+ relations: table.relations.map((r) => ({
34
+ field: r.field,
35
+ referencesTable: `${r.references.schema}.${r.references.table}`,
36
+ referencesColumn: r.references.column,
37
+ meaning: r.meaning,
38
+ })),
39
+ checkConstraints: table.rawTable.checks.map((c) => ({
40
+ name: c.name,
41
+ expression: c.expression,
42
+ })),
43
+ };
44
+ }
45
+ //# sourceMappingURL=describe_table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe_table.js","sourceRoot":"","sources":["../../src/tools/describe_table.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,GAIzB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,UAAU,aAAa,CAAC,KAAyB,EAAE,GAAkB;IACzE,MAAM,MAAM,GAAG,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrD,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,aAAa,CAAC,CAAC;IAC/E,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oBAAoB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA6C,CAAC;IAC/E,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,SAAS,EAAE,CAAC;QAClC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE;YAC/B,KAAK,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,CAAC,KAAK,EAAE;YACzD,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,MAAM;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,MAAM,OAAO,GAA0B,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/D,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;QACpB,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;QAC1B,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,UAAU,EAAE,CAAC,CAAC,UAAU;QACxB,YAAY,EAAE,CAAC,CAAC,YAAY;QAC5B,UAAU,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI;KAClD,CAAC,CAAC,CAAC;IAEJ,OAAO;QACL,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,OAAO;QACP,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACrC,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,eAAe,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE;YAC/D,gBAAgB,EAAE,CAAC,CAAC,UAAU,CAAC,MAAM;YACrC,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;QACH,gBAAgB,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAClD,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,UAAU,EAAE,CAAC,CAAC,UAAU;SACzB,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SchemaContext } from '@kozou/core';
2
+ import { type DescribeViewInput, type DescribeViewOutput } from '../schemas/describe_view.js';
3
+ export declare function describeView(input: DescribeViewInput, ctx: SchemaContext): DescribeViewOutput;
4
+ //# sourceMappingURL=describe_view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe_view.d.ts","sourceRoot":"","sources":["../../src/tools/describe_view.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB,CAyB7F"}
@@ -0,0 +1,28 @@
1
+ import { describeViewInputSchema, } from '../schemas/describe_view.js';
2
+ export function describeView(input, ctx) {
3
+ const parsed = describeViewInputSchema.parse(input);
4
+ const view = ctx.views.find((v) => v.qualifiedName === parsed.qualifiedName);
5
+ if (!view) {
6
+ throw new Error(`View not found: ${parsed.qualifiedName}`);
7
+ }
8
+ return {
9
+ qualifiedName: view.qualifiedName,
10
+ label: view.label,
11
+ description: view.description,
12
+ aiDescription: view.aiDescription,
13
+ columns: view.columns.map((c) => ({
14
+ name: c.name,
15
+ dataType: c.dataType,
16
+ nullable: c.nullable,
17
+ defaultExpr: c.defaultExpr,
18
+ description: c.description,
19
+ aiDescription: c.aiDescription,
20
+ enumValues: c.enumValues,
21
+ isForeignKey: c.isForeignKey,
22
+ references: null,
23
+ })),
24
+ underlyingTables: view.underlyingTables.map((t) => `${t.schema}.${t.name}`),
25
+ definition: view.rawView.definition,
26
+ };
27
+ }
28
+ //# sourceMappingURL=describe_view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe_view.js","sourceRoot":"","sources":["../../src/tools/describe_view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,GAGxB,MAAM,6BAA6B,CAAC;AAErC,MAAM,UAAU,YAAY,CAAC,KAAwB,EAAE,GAAkB;IACvE,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7E,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAChC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,aAAa,EAAE,CAAC,CAAC,aAAa;YAC9B,UAAU,EAAE,CAAC,CAAC,UAAU;YACxB,YAAY,EAAE,CAAC,CAAC,YAAY;YAC5B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QACH,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3E,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SchemaContext } from '@kozou/core';
2
+ import { type GetConceptContextInput, type GetConceptContextOutput } from '../schemas/get_concept_context.js';
3
+ export declare function getConceptContext(input: GetConceptContextInput, ctx: SchemaContext): GetConceptContextOutput;
4
+ //# sourceMappingURL=get_concept_context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_concept_context.d.ts","sourceRoot":"","sources":["../../src/tools/get_concept_context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAE3C,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,sBAAsB,EAC7B,GAAG,EAAE,aAAa,GACjB,uBAAuB,CAsBzB"}
@@ -0,0 +1,25 @@
1
+ import { getConceptContextInputSchema, } from '../schemas/get_concept_context.js';
2
+ export function getConceptContext(input, ctx) {
3
+ const parsed = getConceptContextInputSchema.parse(input);
4
+ const concept = ctx.concepts.find((c) => c.name === parsed.name);
5
+ if (!concept) {
6
+ throw new Error(`Concept not found: ${parsed.name}`);
7
+ }
8
+ const view = ctx.views.find((v) => v.name === concept.name);
9
+ const relatedTables = view ? view.underlyingTables.map((t) => `${t.schema}.${t.name}`) : [];
10
+ return {
11
+ name: concept.name,
12
+ label: concept.label,
13
+ description: concept.description,
14
+ aiNotes: concept.aiNotes,
15
+ preferredQuerySource: `FROM ${concept.name}`,
16
+ joinSuggestions: concept.joinSuggestions.map((j) => ({
17
+ table: j.table,
18
+ on: j.on,
19
+ purpose: '',
20
+ })),
21
+ relatedTables,
22
+ exampleQueries: [],
23
+ };
24
+ }
25
+ //# sourceMappingURL=get_concept_context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_concept_context.js","sourceRoot":"","sources":["../../src/tools/get_concept_context.ts"],"names":[],"mappings":"AACA,OAAO,EACL,4BAA4B,GAG7B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,UAAU,iBAAiB,CAC/B,KAA6B,EAC7B,GAAkB;IAElB,MAAM,MAAM,GAAG,4BAA4B,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC;IACjE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,sBAAsB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IACD,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,oBAAoB,EAAE,QAAQ,OAAO,CAAC,IAAI,EAAE;QAC5C,eAAe,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACnD,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QACH,aAAa;QACb,cAAc,EAAE,EAAE;KACnB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SchemaContext } from '@kozou/core';
2
+ import { type ListConceptsInput, type ListConceptsOutput } from '../schemas/list_concepts.js';
3
+ export declare function listConcepts(input: ListConceptsInput, ctx: SchemaContext): ListConceptsOutput;
4
+ //# sourceMappingURL=list_concepts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list_concepts.d.ts","sourceRoot":"","sources":["../../src/tools/list_concepts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACxB,MAAM,6BAA6B,CAAC;AAErC,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,GAAG,kBAAkB,CAU7F"}
@@ -0,0 +1,13 @@
1
+ import { listConceptsInputSchema, } from '../schemas/list_concepts.js';
2
+ export function listConcepts(input, ctx) {
3
+ listConceptsInputSchema.parse(input);
4
+ return {
5
+ concepts: ctx.concepts.map((c) => ({
6
+ name: c.name,
7
+ label: c.label,
8
+ description: c.description,
9
+ kind: c.kind,
10
+ })),
11
+ };
12
+ }
13
+ //# sourceMappingURL=list_concepts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list_concepts.js","sourceRoot":"","sources":["../../src/tools/list_concepts.ts"],"names":[],"mappings":"AACA,OAAO,EACL,uBAAuB,GAGxB,MAAM,6BAA6B,CAAC;AAErC,MAAM,UAAU,YAAY,CAAC,KAAwB,EAAE,GAAkB;IACvE,uBAAuB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO;QACL,QAAQ,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjC,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,IAAI,EAAE,CAAC,CAAC,IAAI;SACb,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SchemaContext } from '@kozou/core';
2
+ import { type ListTablesInput, type ListTablesOutput } from '../schemas/list_tables.js';
3
+ export declare function listTables(input: ListTablesInput, ctx: SchemaContext): ListTablesOutput;
4
+ //# sourceMappingURL=list_tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list_tables.d.ts","sourceRoot":"","sources":["../../src/tools/list_tables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,aAAa,GAAG,gBAAgB,CAavF"}
@@ -0,0 +1,16 @@
1
+ import { listTablesInputSchema, } from '../schemas/list_tables.js';
2
+ export function listTables(input, ctx) {
3
+ const parsed = listTablesInputSchema.parse(input);
4
+ const schema = parsed.schema ?? 'public';
5
+ return {
6
+ tables: ctx.tables
7
+ .filter((t) => t.schema === schema)
8
+ .map((t) => ({
9
+ qualifiedName: t.qualifiedName,
10
+ label: t.label,
11
+ description: t.description,
12
+ rowCountEstimate: null,
13
+ })),
14
+ };
15
+ }
16
+ //# sourceMappingURL=list_tables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list_tables.js","sourceRoot":"","sources":["../../src/tools/list_tables.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,GAGtB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,UAAU,UAAU,CAAC,KAAsB,EAAE,GAAkB;IACnE,MAAM,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC;IACzC,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;aACf,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC;aAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,aAAa,EAAE,CAAC,CAAC,aAAa;YAC9B,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;KACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { SchemaContext } from '@kozou/core';
2
+ import { type ListViewsInput, type ListViewsOutput } from '../schemas/list_views.js';
3
+ export declare function listViews(input: ListViewsInput, ctx: SchemaContext): ListViewsOutput;
4
+ //# sourceMappingURL=list_views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list_views.d.ts","sourceRoot":"","sources":["../../src/tools/list_views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,aAAa,GAAG,eAAe,CAYpF"}
@@ -0,0 +1,15 @@
1
+ import { listViewsInputSchema, } from '../schemas/list_views.js';
2
+ export function listViews(input, ctx) {
3
+ const parsed = listViewsInputSchema.parse(input);
4
+ const schema = parsed.schema ?? 'public';
5
+ return {
6
+ views: ctx.views
7
+ .filter((v) => v.schema === schema)
8
+ .map((v) => ({
9
+ qualifiedName: v.qualifiedName,
10
+ label: v.label,
11
+ purpose: v.purpose,
12
+ })),
13
+ };
14
+ }
15
+ //# sourceMappingURL=list_views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list_views.js","sourceRoot":"","sources":["../../src/tools/list_views.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,GAGrB,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,SAAS,CAAC,KAAqB,EAAE,GAAkB;IACjE,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,QAAQ,CAAC;IACzC,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,KAAK;aACb,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC;aAClC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACX,aAAa,EAAE,CAAC,CAAC,aAAa;YAC9B,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,OAAO,EAAE,CAAC,CAAC,OAAO;SACnB,CAAC,CAAC;KACN,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,51 @@
1
1
  {
2
2
  "name": "@kozou/mcp",
3
- "version": "0.0.1",
4
- "description": "Placeholder; v0.1.0 release lands via CI shortly.",
3
+ "version": "0.1.0",
4
+ "description": "Kozou MCP server for AI agents (stdio; HTTP coming in v0.1.1)",
5
5
  "license": "Apache-2.0",
6
- "publishConfig": { "access": "public" }
7
- }
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/kozou-dev/kozou.git",
9
+ "directory": "packages/mcp"
10
+ },
11
+ "homepage": "https://kozou.org",
12
+ "bugs": {
13
+ "url": "https://github.com/kozou-dev/kozou/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "exports": {
19
+ ".": {
20
+ "import": "./dist/index.js",
21
+ "types": "./dist/index.d.ts"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "bin": {
26
+ "kozou-mcp": "./dist/cli.js"
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "provenance": true
34
+ },
35
+ "dependencies": {
36
+ "@modelcontextprotocol/sdk": "^1.0.0",
37
+ "pg": "^8.13.0",
38
+ "zod": "^3.23.0",
39
+ "@kozou/core": "0.1.0",
40
+ "@kozou/introspect": "0.1.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/pg": "^8.11.0",
44
+ "tsx": "^4.19.0"
45
+ },
46
+ "scripts": {
47
+ "typecheck": "tsc --noEmit",
48
+ "build": "tsc",
49
+ "test": "vitest run --coverage"
50
+ }
51
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # @kozou/mcp
2
-
3
- Placeholder publish. The real v0.1.0 release lands via CI shortly. See https://github.com/kozou-dev/kozou for the source.