Skip to content

Commit 3dd3399

Browse files
author
flowcore-platform
committed
feat(build): ✨ Add file copying to build process
1 parent 4b5533c commit 3dd3399

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"README.md"
1515
],
1616
"scripts": {
17-
"build": "bun build ./src/index.ts --outdir ./dist --target node",
17+
"build": "bun build ./src/index.ts --outdir ./dist --target node && bun run copy-files",
18+
"copy-files": "bun run scripts/copy-files.ts",
1819
"prepublishOnly": "bun run build",
1920
"inspect": "bunx @modelcontextprotocol/inspector bun src/index.ts",
2021
"lint": "biome lint",

scripts/copy-files.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bun
2+
/**
3+
* This script copies package.json and README.md to the dist folder
4+
* It's used as part of the build process
5+
*/
6+
7+
import { mkdir } from "node:fs/promises"
8+
import { join } from "node:path"
9+
10+
// Ensure dist directory exists
11+
await mkdir("dist", { recursive: true })
12+
13+
// Copy package.json to dist folder
14+
const packageJson = Bun.file("package.json")
15+
await Bun.write(join("dist", "package.json"), packageJson)
16+
console.log("✅ Copied package.json to dist folder")
17+
18+
// Copy README.md to dist folder
19+
const readme = Bun.file("README.md")
20+
await Bun.write(join("dist", "README.md"), readme)
21+
console.log("✅ Copied README.md to dist folder")
22+
23+
console.log("🎉 All files copied successfully!")

src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mc
44
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
55
import { parseArgs } from "node:util"
66
import { z } from "zod"
7+
// Import package.json for version
8+
import pkg from "../package.json"
79
import { dataCoreResource, eventTypeResource, flowTypeResource, tenantResource } from "./resources"
810
import {
911
getEventTypeInfoHandler,
@@ -50,9 +52,9 @@ const flowcoreClient = new FlowcoreClient({
5052
// Create an MCP server
5153
const server = new McpServer({
5254
name: "Flowcore Platform",
53-
version: "1.0.0",
55+
version: pkg.version,
5456
description:
55-
"An MCP server for managing and interacting with Flowcore Platform. For information on the details of the flowcore platform, you can check the Flowcore Platform Data Core, as it houses all actions that have happened in the platform. These actions are called events and are the main building blocks of the platform and housed within the data core inside the event type. The hirearchy of the platform is as follows: Users -> Tenant -> Data Core -> Flow Type -> Event Type -> Events. Tenants and organizations are the same thing in the platform, we are transitioning to use the term tenant. The events are stored in time buckets, and can be fetched by using the get_time_buckets tool.",
57+
"An MCP server for managing and interacting with Flowcore Platform. For information on the details of the flowcore platform, you can check the Flowcore Platform Data Core, as it houses all actions that have happened in the platform. These actions are called events and are the main building blocks of the platform and housed within the data core inside the event type. The hirearchy of the platform is as follows: Users -> Tenant -> Data Core -> Flow Type -> Event Type -> Events. Tenants and organizations are the same thing in the platform, we are transitioning to use the term tenant. The events are stored in time buckets, and can be fetched by using the get_time_buckets tool. When you fetch events from a time bucket, you can use the cursor to paginate through the events. The default page size is 500 events per page, but you can change this by using the pageSize parameter. Also, the order of the events fetched from each time bucket is ascending by default, but you can change this by using the order parameter but keep in mind that when using desc, pagination and filters are not possible.",
5658
})
5759

5860
server.tool("list_tenants", "List all tenants I have access to", listTenantsHandler(flowcoreClient))
@@ -101,7 +103,7 @@ server.tool(
101103
"The time bucket to get events from, the timebucket is in the format of YYYYMMDDhhiiss, normally the ii and ss are 0000",
102104
),
103105
cursor: z.string().optional().describe("The paging cursor for pagination"),
104-
pageSize: z.number().optional().describe("The number of events per page (default is 10,000)"),
106+
pageSize: z.number().default(500).describe("The number of events per page (default is 500)"),
105107
fromEventId: z.string().optional().describe("Start from this event ID"),
106108
afterEventId: z
107109
.string()
@@ -122,7 +124,7 @@ server.tool(
122124
{
123125
eventTypeId: z.string().describe("Event type ID to get time buckets for"),
124126
fromTimeBucket: z.string().optional().describe("Start time bucket (YYYYMMDDhhiiss)"),
125-
toTimeBucket: z.string().optional().describe("End time bucket (YYYYMMDDhhiiss)"),
127+
toTimeBucket: z.string().optional().describe("End time bucket (YYYYMMDDhhiiss)"),
126128
pageSize: z.number().optional().describe("Number of time buckets per page"),
127129
cursor: z.number().optional().describe("Pagination cursor"),
128130
order: z.enum(["asc", "desc"]).optional().describe("Sort order"),

0 commit comments

Comments
 (0)