@cronicorn/mcp-server 1.5.8 → 1.6.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.
@@ -0,0 +1,179 @@
1
+ ---
2
+ id: developer-workspace-structure
3
+ title: Workspace Structure
4
+ description: Overview of monorepo workspaces (apps and packages)
5
+ tags:
6
+ - developer
7
+ - architecture
8
+ sidebar_position: 3
9
+ mcp:
10
+ uri: file:///docs/developers/workspace-structure.md
11
+ mimeType: text/markdown
12
+ priority: 0.7
13
+ ---
14
+
15
+ # Workspace Structure
16
+
17
+ Cronicorn is organized as a pnpm monorepo with 8 apps and 13 packages. This guide helps you quickly locate code for specific features.
18
+
19
+ ## Apps (8)
20
+
21
+ Deployable applications and services.
22
+
23
+ ### `@cronicorn/api`
24
+ HTTP API server using Hono framework with OpenAPI/Swagger support and Better Auth authentication.
25
+ - **Tech**: Hono, Zod, Better Auth, Drizzle ORM
26
+ - **Port**: Configurable via env
27
+ - **Location**: `apps/api/`
28
+
29
+ ### `@cronicorn/web`
30
+ Frontend web application built with React and TanStack Router.
31
+ - **Tech**: React 19, TanStack Router, Vite, Tailwind CSS 4
32
+ - **Dev**: Vite dev server with HMR
33
+ - **Location**: `apps/web/`
34
+
35
+ ### `@cronicorn/scheduler-app`
36
+ Background worker that claims and executes scheduled job endpoints.
37
+ - **Tech**: Pino logging, Drizzle ORM, HTTP dispatcher
38
+ - **Purpose**: Main scheduling loop execution
39
+ - **Location**: `apps/scheduler/`
40
+
41
+ ### `@cronicorn/ai-planner-app`
42
+ AI-powered worker that optimizes scheduling decisions using OpenAI.
43
+ - **Tech**: Vercel AI SDK, OpenAI provider
44
+ - **Purpose**: Adaptive scheduling intelligence
45
+ - **Location**: `apps/ai-planner/`
46
+
47
+ ### `@cronicorn/docs`
48
+ Docusaurus-based documentation website.
49
+ - **Tech**: Docusaurus 3.9.2
50
+ - **Purpose**: Public and developer documentation
51
+ - **Location**: `apps/docs/`
52
+
53
+ ### `@cronicorn/mcp-server`
54
+ Model Context Protocol server enabling AI agents to manage cron jobs.
55
+ - **Tech**: MCP SDK
56
+ - **Published**: Yes (public npm package)
57
+ - **Binary**: `cronicorn-mcp`
58
+ - **Location**: `apps/mcp-server/`
59
+
60
+ ### `@cronicorn/migrator`
61
+ Database migration runner using Drizzle Kit.
62
+ - **Purpose**: Run migrations on startup or manually
63
+ - **Location**: `apps/migrator/`
64
+
65
+ ### `@cronicorn/test-ai`
66
+ Test harness for AI integration experiments.
67
+ - **Purpose**: Development/testing only
68
+ - **Location**: `apps/test-ai/`
69
+
70
+ ---
71
+
72
+ ## Packages (13)
73
+
74
+ Shared libraries and adapters used by apps.
75
+
76
+ ### Adapters (7)
77
+
78
+ Implement domain ports using external libraries/services.
79
+
80
+ #### `@cronicorn/adapter-ai`
81
+ AI SDK integration with mock support (MSW).
82
+ - **Location**: `packages/adapter-ai/`
83
+
84
+ #### `@cronicorn/adapter-cron`
85
+ Cron expression parsing using cron-parser.
86
+ - **Location**: `packages/adapter-cron/`
87
+
88
+ #### `@cronicorn/adapter-drizzle`
89
+ PostgreSQL database adapter with Drizzle ORM schema and repositories.
90
+ - **Location**: `packages/adapter-drizzle/`
91
+
92
+ #### `@cronicorn/adapter-http`
93
+ HTTP request dispatcher for endpoint execution.
94
+ - **Location**: `packages/adapter-http/`
95
+
96
+ #### `@cronicorn/adapter-pino`
97
+ Structured logging with Pino.
98
+ - **Location**: `packages/adapter-pino/`
99
+
100
+ #### `@cronicorn/adapter-stripe`
101
+ Stripe payment integration for subscriptions.
102
+ - **Location**: `packages/adapter-stripe/`
103
+
104
+ #### `@cronicorn/adapter-system-clock`
105
+ System clock implementation for production (vs fake clock for tests).
106
+ - **Location**: `packages/adapter-system-clock/`
107
+
108
+ ### Core Domain (3)
109
+
110
+ #### `@cronicorn/domain`
111
+ Pure domain logic: ports, entities, policies, governor, scheduler (no external dependencies except Zod).
112
+ - **Location**: `packages/domain/`
113
+ - **Key**: All business rules live here
114
+
115
+ #### `@cronicorn/services`
116
+ Business logic layer: job management, scheduling services.
117
+ - **Location**: `packages/services/`
118
+
119
+ #### `@cronicorn/api-contracts`
120
+ OpenAPI contracts and Zod schemas for HTTP API routes (shared between API and Web).
121
+ - **Location**: `packages/api-contracts/`
122
+
123
+ ### Workers (2)
124
+
125
+ #### `@cronicorn/worker-scheduler`
126
+ Core scheduling worker logic with simulation support.
127
+ - **Script**: `pnpm sim` runs deterministic scenarios
128
+ - **Location**: `packages/worker-scheduler/`
129
+
130
+ #### `@cronicorn/worker-ai-planner`
131
+ AI planner worker logic (orchestrates AI hints and nudges).
132
+ - **Location**: `packages/worker-ai-planner/`
133
+
134
+ ### UI (1)
135
+
136
+ #### `@cronicorn/ui-library`
137
+ Shared React component library using shadcn/ui with Radix UI primitives.
138
+ - **Tech**: Tailwind CSS 4, Radix UI, React Hook Form, Recharts
139
+ - **Location**: `packages/ui-library/`
140
+
141
+ ### Content (1)
142
+
143
+ #### `@cronicorn/content`
144
+ Centralized content: brand assets, pricing, FAQs, SEO metadata, business copy.
145
+ - **Exports**: Multiple subpaths (brand, pricing, docs, seo, etc.)
146
+ - **Location**: `packages/content/`
147
+
148
+ ---
149
+
150
+ ## Other folders
151
+
152
+ #### `/docs`
153
+ Central docs folder that is used by the docs app and mcp-server
154
+
155
+
156
+ ## Key Architecture Notes
157
+
158
+ - **Monorepo**: pnpm workspaces with TypeScript project references
159
+ - **Build**: Packages build with `tsc`, apps use `tsx` (dev) or `tsc` (prod)
160
+ - **Env**: Single `.env` file at root, loaded via `dotenv-cli`
161
+ - **Testing**: Vitest with transaction-per-test pattern
162
+ - **Ports & Adapters**: Clean separation between domain and infrastructure
163
+
164
+ ## Finding Code
165
+
166
+ | Looking for... | Check... |
167
+ |----------------|----------|
168
+ | API routes | `apps/api/src/routes/` |
169
+ | Database schema | `packages/adapter-drizzle/src/schema/` |
170
+ | Scheduling logic | `packages/domain/src/scheduler.ts` |
171
+ | UI components | `packages/ui-library/src/components/` |
172
+ | AI prompts | `packages/worker-ai-planner/src/` |
173
+ | HTTP dispatcher | `packages/adapter-http/` |
174
+ | Business logic | `packages/services/` |
175
+
176
+ ## Next Steps
177
+
178
+ - **[System Architecture](../technical/system-architecture.md)** - How components interact at runtime
179
+ - **[Quick Start](./quick-start.md)** - Set up your dev environment
@@ -0,0 +1,82 @@
1
+ ---
2
+ title: Troubleshooting Authentication
3
+ description: How to resolve authentication issues with the Cronicorn MCP Server
4
+ mcp:
5
+ uri: "cronicorn://troubleshooting/authentication"
6
+ priority: 10
7
+ tags: [user, assistant]
8
+ ---
9
+
10
+ # Troubleshooting Authentication
11
+
12
+ ## Authentication Failed (401 Unauthorized)
13
+
14
+ If you see this error:
15
+ ```
16
+ Authentication failed. Invalid or expired token. Please restart the MCP server to re-authenticate.
17
+ ```
18
+
19
+ **What happened:**
20
+ - Your authentication token is no longer valid
21
+ - The MCP server has automatically cleared the invalid credentials
22
+
23
+ **How to fix:**
24
+
25
+ 1. **Restart your editor/IDE:**
26
+ - **VS Code**: Reload the window (`Cmd+Shift+P` → "Developer: Reload Window")
27
+ - **Other editors**: Restart the application
28
+
29
+ 2. **Complete the device flow:**
30
+ - A browser window will automatically open
31
+ - Sign in with your GitHub account
32
+ - Approve the device authorization request
33
+ - The MCP server will save the new credentials
34
+
35
+ 3. **Try your operation again**
36
+
37
+ ## Token Expired
38
+
39
+ If you see messages about an expired token during startup, don't worry! The MCP server automatically:
40
+ 1. Detects the expired token
41
+ 2. Deletes the invalid credentials
42
+ 3. Starts a new device authorization flow
43
+
44
+ Just complete the browser-based approval and you're good to go.
45
+
46
+ ## Manual Credential Reset
47
+
48
+ If you need to manually reset your credentials:
49
+
50
+ ```bash
51
+ # Delete the credentials file
52
+ rm ~/.cronicorn/credentials.json
53
+
54
+ # Restart your editor/IDE
55
+ ```
56
+
57
+ ## Where Are Credentials Stored?
58
+
59
+ Credentials are stored in: `~/.cronicorn/credentials.json`
60
+
61
+ This file contains:
62
+ - `access_token`: Your authentication token
63
+ - `refresh_token`: Token for refreshing (currently not used)
64
+ - `expires_at`: Unix timestamp when the token expires
65
+
66
+ The file has restricted permissions (0600) so only you can read it.
67
+
68
+ ## Common Issues
69
+
70
+ ### Browser Doesn't Open Automatically
71
+ - Manually navigate to the verification URL shown in the server logs
72
+ - Enter the user code displayed
73
+
74
+ ### Device Code Expired
75
+ - You have 30 minutes to approve the device
76
+ - If it expires, just restart the MCP server to get a new code
77
+
78
+ ### Still Having Issues?
79
+ - Check that the Cronicorn API is accessible
80
+ - Verify your internet connection
81
+ - Look for error messages in the MCP server logs (stderr)
82
+ - Report issues on [GitHub Discussions](https://github.com/weskerllc/cronicorn/discussions)