@flareum/mcp 0.2.0 → 0.2.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 CHANGED
@@ -13,7 +13,7 @@ typing literal values.
13
13
  2. Copy the command it shows you. It looks like this:
14
14
 
15
15
  ```bash
16
- claude mcp add flareum --env FLAREUM_TOKEN=pk_… -- npx -y @flareum/mcp
16
+ claude mcp add flareum --env FLAREUM_TOKEN=pk_… -- npx -y -p @flareum/mcp flareum-mcp
17
17
  ```
18
18
 
19
19
  3. Run it in **your project's** terminal — the repo where you write CSS/SCSS, not the Flareum repo.
@@ -23,6 +23,33 @@ The key is shown once and cannot be retrieved again. If you lose it, revoke it a
23
23
 
24
24
  ---
25
25
 
26
+ ## Updating
27
+
28
+ `npx` caches what it downloaded, so it can keep running an old copy after a new one ships. To get
29
+ the newest:
30
+
31
+ ```bash
32
+ npx -y -p @flareum/mcp@latest flareum --help
33
+ ```
34
+
35
+ Naming `@latest` is what refreshes the cache. Then restart your editor session — a running MCP
36
+ server keeps the version it started with.
37
+
38
+ Check which version you are actually on:
39
+
40
+ ```bash
41
+ npm view @flareum/mcp version # the newest published
42
+ npx -y -p @flareum/mcp@latest flareum --version
43
+ ```
44
+
45
+ If you installed it globally instead of through `npx`:
46
+
47
+ ```bash
48
+ npm install -g @flareum/mcp@latest
49
+ ```
50
+
51
+ ---
52
+
26
53
  ## What your agent can do with it
27
54
 
28
55
  Ask in plain language — the agent picks the tool:
@@ -53,8 +80,8 @@ The tools tell an agent what a token is CALLED. The stylesheets that give those
53
80
  from a Push, and this fetches them:
54
81
 
55
82
  ```bash
56
- npx flareum pull # into src/styles/flareum
57
- npx flareum watch # and again every time you Push in Flareum
83
+ npx -y -p @flareum/mcp flareum pull # into src/styles/flareum
84
+ npx -y -p @flareum/mcp flareum watch # and again every time you Push in Flareum
58
85
  ```
59
86
 
60
87
  Then import them once, in your global stylesheet:
@@ -99,7 +126,8 @@ and it prints where it wrote (or why it could not) on stderr.
99
126
 
100
127
  | What you see | Cause |
101
128
  |---|---|
102
- | The server fails to connect / closes immediately | The package is not installed. Check `npx -y @flareum/mcp` resolves — if it 404s, it has not been published yet. |
129
+ | The server fails to connect / closes immediately | The package is not installed. Check `npx -y -p @flareum/mcp flareum-mcp` resolves — if it 404s, it has not been published yet. |
130
+ | A command the docs describe is not recognised | `npx` is running a cached older copy. Re-run it as `@latest` — see Updating. |
103
131
  | The agent types literal values anyway | The skill did not land. Look for `[flareum] skill written to …` in the MCP server's stderr. |
104
132
  | Values labelled with long ids instead of mode names | The Flareum server is older than the client. Restart it. |
105
133
  | `401` on every call | The key was revoked, or belongs to another project. Mint a new one. |
package/dist/cli.js CHANGED
@@ -6,6 +6,8 @@ import { CONFIG_PATH, cliErrorReport, parseArgs, resolveConfig } from './config.
6
6
  import { pullReport, pullStyles } from './pull.js';
7
7
  import { DEFAULT_INTERVAL_MS, watchPublished, watchStartedReport } from './watch.js';
8
8
  const DEFAULT_OUT = 'src/styles/flareum';
9
+ // Read rather than restated: a hardcoded version is wrong the moment `npm version` runs.
10
+ const VERSION = JSON.parse(await readFile(new URL('../package.json', import.meta.url), 'utf8')).version;
9
11
  const HELP = `flareum — read a Flareum project's design tokens
10
12
 
11
13
  flareum pull [--out <dir>] [--token pk_…] [--api <url>]
@@ -20,6 +22,16 @@ Mint one in the project's Connect screen in Flareum.`;
20
22
  const readConfigFile = async () => readFile(join(process.cwd(), CONFIG_PATH), 'utf8').then(JSON.parse).catch(() => null);
21
23
  const { command, flags } = parseArgs(process.argv.slice(2));
22
24
  const COMMANDS = ['pull', 'watch'];
25
+ // Read from flags, not `command`: parseArgs takes every leading `--x` as a flag, so checking the
26
+ // command alone printed the help instead.
27
+ if (flags.version || command === '-v') {
28
+ console.log(VERSION);
29
+ process.exit(0);
30
+ }
31
+ if (flags.help || command === '-h') {
32
+ console.log(HELP);
33
+ process.exit(0);
34
+ }
23
35
  if (!COMMANDS.includes(command)) {
24
36
  console.log(HELP);
25
37
  process.exit(command ? 1 : 0);
package/dist/server.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  // Transport glue only. Every behaviour worth guarding lives in client.ts and tools.ts, which have
3
3
  // no SDK dependency and are tested without one.
4
+ import { readFileSync } from 'node:fs';
4
5
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
5
6
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
6
7
  import { CallToolRequestSchema, ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
@@ -12,7 +13,9 @@ const client = new FlareumClient({
12
13
  api: process.env.FLAREUM_API,
13
14
  projectId: process.env.FLAREUM_PROJECT,
14
15
  });
15
- const server = new Server({ name: 'flareum', version: '0.1.0' }, { capabilities: { tools: {} } });
16
+ // Read, never restated: the hardcoded 0.1.0 kept reporting itself from a 0.2.1 package.
17
+ const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
18
+ const server = new Server({ name: 'flareum', version }, { capabilities: { tools: {} } });
16
19
  server.setRequestHandler(ListToolsRequestSchema, async () => ({
17
20
  tools: [
18
21
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareum/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Connect a coding agent to a Flareum project's design tokens.",
5
5
  "license": "MIT",
6
6
  "author": "Flareum",