@famgia/omnify-mcp 0.0.2
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/README.md +157 -0
- package/dist/index.cjs +693 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +675 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -0
package/README.md
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# @famgia/omnify-mcp
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) Server for Omnify - enables AI assistants like Claude to create and validate Omnify schemas.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **omnify_create_schema** - Generate schema YAML from structured input
|
|
8
|
+
- **omnify_validate_schema** - Validate schema YAML content
|
|
9
|
+
- **omnify_get_types** - Get documentation for property types
|
|
10
|
+
- **omnify_get_relationships** - Get documentation for relationship types
|
|
11
|
+
- **omnify_get_examples** - Get example schemas for common use cases
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### For Claude Code
|
|
16
|
+
|
|
17
|
+
Add to your Claude Code MCP settings (`~/.claude/claude_desktop_config.json`):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"mcpServers": {
|
|
22
|
+
"omnify": {
|
|
23
|
+
"command": "npx",
|
|
24
|
+
"args": ["@famgia/omnify-mcp"]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### For Claude Desktop
|
|
31
|
+
|
|
32
|
+
Add to your Claude Desktop config:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"omnify": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["@famgia/omnify-mcp"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Global Installation
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm install -g @famgia/omnify-mcp
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then use `omnify-mcp` as the command.
|
|
52
|
+
|
|
53
|
+
## Available Tools
|
|
54
|
+
|
|
55
|
+
### omnify_create_schema
|
|
56
|
+
|
|
57
|
+
Create an Omnify schema YAML file from structured input.
|
|
58
|
+
|
|
59
|
+
**Example:**
|
|
60
|
+
```
|
|
61
|
+
Create a User schema with name, email (unique), password, and posts relation
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Parameters:**
|
|
65
|
+
- `name` (required): Schema name in PascalCase
|
|
66
|
+
- `kind`: 'object' or 'enum' (default: 'object')
|
|
67
|
+
- `displayName`: String or locale map for i18n
|
|
68
|
+
- `group`: Schema group for organization
|
|
69
|
+
- `properties`: Property definitions
|
|
70
|
+
- `values`: Enum values (for kind: enum)
|
|
71
|
+
- `options`: Schema options (softDelete, timestamps, etc.)
|
|
72
|
+
|
|
73
|
+
### omnify_validate_schema
|
|
74
|
+
|
|
75
|
+
Validate schema YAML content and get errors/warnings.
|
|
76
|
+
|
|
77
|
+
**Parameters:**
|
|
78
|
+
- `yaml_content` (required): YAML content to validate
|
|
79
|
+
|
|
80
|
+
### omnify_get_types
|
|
81
|
+
|
|
82
|
+
Get documentation for all property types (String, Int, Association, etc.)
|
|
83
|
+
|
|
84
|
+
### omnify_get_relationships
|
|
85
|
+
|
|
86
|
+
Get documentation for relationship types (OneToMany, ManyToMany, polymorphic, etc.)
|
|
87
|
+
|
|
88
|
+
### omnify_get_examples
|
|
89
|
+
|
|
90
|
+
Get example schemas for User, Post, Category, and Enum.
|
|
91
|
+
|
|
92
|
+
## Example Usage with Claude
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
User: Create a schema for a blog post with title, content, status enum, author relation
|
|
96
|
+
|
|
97
|
+
Claude: [Uses omnify_create_schema tool]
|
|
98
|
+
|
|
99
|
+
Generated Schema: Post
|
|
100
|
+
|
|
101
|
+
```yaml
|
|
102
|
+
name: Post
|
|
103
|
+
displayName:
|
|
104
|
+
ja: 投稿
|
|
105
|
+
en: Post
|
|
106
|
+
options:
|
|
107
|
+
softDelete: true
|
|
108
|
+
properties:
|
|
109
|
+
title:
|
|
110
|
+
type: String
|
|
111
|
+
displayName:
|
|
112
|
+
ja: タイトル
|
|
113
|
+
en: Title
|
|
114
|
+
content:
|
|
115
|
+
type: LongText
|
|
116
|
+
status:
|
|
117
|
+
type: EnumRef
|
|
118
|
+
enum: PostStatus
|
|
119
|
+
default: draft
|
|
120
|
+
author:
|
|
121
|
+
type: Association
|
|
122
|
+
relation: ManyToOne
|
|
123
|
+
target: User
|
|
124
|
+
onDelete: CASCADE
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Save to: schemas/blog/Post.yaml
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Resources
|
|
131
|
+
|
|
132
|
+
The server also provides resources that can be accessed:
|
|
133
|
+
|
|
134
|
+
- `omnify://docs/types` - Property types documentation
|
|
135
|
+
- `omnify://docs/relationships` - Relationships documentation
|
|
136
|
+
- `omnify://examples/all` - Example schemas
|
|
137
|
+
|
|
138
|
+
## JSON Schema
|
|
139
|
+
|
|
140
|
+
For IDE autocomplete in YAML files, use the JSON Schema:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/ecsol/omnify-ts/main/packages/types/schemas/omnify-schema.json
|
|
144
|
+
name: MySchema
|
|
145
|
+
properties:
|
|
146
|
+
# IDE will provide autocomplete here
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Related Packages
|
|
150
|
+
|
|
151
|
+
- [@famgia/omnify](https://www.npmjs.com/package/@famgia/omnify) - Main package
|
|
152
|
+
- [@famgia/omnify-laravel](https://www.npmjs.com/package/@famgia/omnify-laravel) - Laravel generator
|
|
153
|
+
- [@famgia/omnify-types](https://www.npmjs.com/package/@famgia/omnify-types) - Type definitions
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT
|