@bicharts/chart-mcp 0.6.103 → 0.6.105
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/dist/check-chart.mjs +75 -75
- package/dist/index.mjs +129 -127
- package/package.json +3 -3
- package/skills/bic-charts/SKILL.md +36 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bicharts/chart-mcp",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.105",
|
|
4
4
|
"description": "AI Data Components for Power BI, Excel, Fabric Apps and the web, over MCP: bivariate maps, what-if projections and about 90 everyday chart types, with selection and cross-filtering already wired. It profiles your table locally; the code it writes is yours and runs with no license.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
},
|
|
48
48
|
"// dependencies": "NONE, deliberately. dist/ bundles every module the server uses, so a runtime dependency installs nothing it needs - it only makes npx fetch that package (and its tree) before the first start. Everything the bundle carries is a devDependency; scripts/verify-package.mjs fails the release if a dependency appears or a shipped file imports anything but Node's built-ins.",
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@bicharts/chart-host": "^0.6.
|
|
51
|
-
"@bicharts/shape-core": "^0.6.
|
|
50
|
+
"@bicharts/chart-host": "^0.6.105",
|
|
51
|
+
"@bicharts/shape-core": "^0.6.105",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.32.1",
|
|
53
53
|
"@types/node": "^26.6.5",
|
|
54
54
|
"@types/papaparse": "^5.3.14",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bic-charts
|
|
3
|
-
description: Build a web app or dashboard containing BIC-generated charts — a bubble map, a table with in-cell bars, linked cross-filtering. Use whenever the bic-chart MCP tools are available and the task is "put a chart
|
|
3
|
+
description: Build a web app or dashboard containing BIC-generated charts, maps, tables and app widgets — a bubble map, a table with in-cell bars, a table readers work with and keep their own way, a what-if widget, linked cross-filtering. Use whenever the bic-chart MCP tools are available and the task is "put a chart, map, table, widget or dashboard in this app".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Building an app with BIC charts
|
|
@@ -9,6 +9,11 @@ The golden path, end to end. Following it costs a handful of tool calls; derivin
|
|
|
9
9
|
first principles costs about thirty, and the places people lose time are all called out
|
|
10
10
|
below because they were all measured.
|
|
11
11
|
|
|
12
|
+
**Not only charts.** Maps, tables a reader works with and app widgets (KPI cards, what-if controls, card decks) are
|
|
13
|
+
built here like any chart: `list_eligible_charts` offers them and `generate_chart` writes each with its component.
|
|
14
|
+
Asked for one, list first, before hand-building it or reaching for another grid, map or widget library; step 5 says
|
|
15
|
+
how a generated table's component keeps the reader's view.
|
|
16
|
+
|
|
12
17
|
**The mental model.** A BIC chart is *generated source you own* — a plain
|
|
13
18
|
`render(container, data, options)` function you commit to your repo. There is no API key at
|
|
14
19
|
run time, no per-render cost, and no network call. `@bicharts/chart-host` runs it; the MCP
|
|
@@ -553,9 +558,21 @@ overwrites a file, and its reply ends with a worked example. Building notes on m
|
|
|
553
558
|
data service is on (the notes recipe below, step a), run it again with `features: ["notes", "scenarios"]`: it writes
|
|
554
559
|
those files finished.
|
|
555
560
|
|
|
561
|
+
**The model's name is the `connection`.** Connect the semantic model the way the template's AGENTS.md says - before or
|
|
562
|
+
after `setup_fabric_app`, whose reply names it either way. On the template's current layout the model is a Rayfin
|
|
563
|
+
connector: `npx rayfin connector search "<model name>" --all-workspaces --type fabric-semanticmodel --json`, then the
|
|
564
|
+
`npx rayfin connector add --type fabric-semanticmodel --name <name> --workspace-id <id> --item-id <id>` it prints (ids from
|
|
565
|
+
the search, never guessed); the connector's name in `rayfin/rayfin.yml` is what `useSemanticModelQuery({ connection })`
|
|
566
|
+
takes. On the template's older layout (a `fabric.yaml`, `@microsoft/fabric-app-data`) it is the model's alias in
|
|
567
|
+
`fabric.yaml`. `query_semantic_model` and `suggest_charts` read it from whichever file the project has; pass `alias` only
|
|
568
|
+
when the project declares more than one.
|
|
569
|
+
|
|
556
570
|
**1. Pull each chart's rows at the chart's GRAIN, with a query written for that chart.** One row per
|
|
557
|
-
country for a country map, one per route for a flow map, one per month for a trend. The template's
|
|
558
|
-
|
|
571
|
+
country for a country map, one per route for a flow map, one per month for a trend. The template's own
|
|
572
|
+
command runs a `.dax` file through the connector: `npx fabric-app-semantic-model-tools run-dax-query --dax <file.dax>
|
|
573
|
+
--alias <connector>` (on its older layout, `npx fabric-app-data query <alias> --query '<DAX>'`).
|
|
574
|
+
`query_semantic_model` runs the query through that same connector and the project's own sign-in, so a query it returned
|
|
575
|
+
has passed the template's check: don't run it again with `run-dax-query`. Don't pull a fact
|
|
559
576
|
table and aggregate it in the browser: the Execute Queries API refuses a response over 15 MB, and a
|
|
560
577
|
column repeated on every fact row (a country's population on each sale) sums to nonsense.
|
|
561
578
|
|
|
@@ -573,12 +590,14 @@ name. Pass the model's metadata as you rename: `isMeasure`, `format` and `descri
|
|
|
573
590
|
Power BI visual gets for free. In `INFO.VIEW.COLUMNS()` a column's name is `[Name]`, not `[Column]`.
|
|
574
591
|
|
|
575
592
|
**Steps 1-3 are one call: `query_semantic_model`.** Give it the chart's DAX (`dax`, or a `.dax` file) and a
|
|
576
|
-
`name`; it runs the query through the project's own
|
|
593
|
+
`name`; it runs the query through the project's own tooling - the model's Rayfin connector (through
|
|
594
|
+
`@microsoft/fabric-app-semantic-model-tools`, else the Rayfin CLI), or on the older layout the `fabric-app-data` CLI - so
|
|
595
|
+
it signs in and gets the reply the app will get. It renames the headers (dropping the
|
|
577
596
|
table and any symbols: `[Occupancy %]` becomes `Occupancy`), saves every row to `.bic/data/<name>.csv`,
|
|
578
597
|
reads each column's role, format and description from the model (`INFO.VIEW.MEASURES()` / `INFO.VIEW.COLUMNS()`),
|
|
579
598
|
and profiles the result. Its reply ends with the arguments for the next two calls - `csv_path`, `measures`,
|
|
580
599
|
`dimensions`, `formats`, `descriptions` - so pass them to `list_eligible_charts` and `generate_chart` as they
|
|
581
|
-
are.
|
|
600
|
+
are. It keeps at most 1,000 rows of a query; the tool says so when it cut a result, and the fix is a query at the
|
|
582
601
|
chart's grain.
|
|
583
602
|
|
|
584
603
|
**4. Ask before choosing, then choose what answers the question.** `list_eligible_charts` on that
|
|
@@ -635,7 +654,8 @@ import { BicChartPanel } from "@/components/bic-chart-panel";
|
|
|
635
654
|
import { useBicChartOptions } from "@/lib/bic-chart-options";
|
|
636
655
|
import QUERY from "@/queries/overview/occupancy-map.dax?raw"; // the template's rule: DAX lives in .dax files
|
|
637
656
|
|
|
638
|
-
|
|
657
|
+
// connection: the model's connector name in rayfin/rayfin.yml (fabric.yaml's alias on the older layout)
|
|
658
|
+
const result = useSemanticModelQuery({ connection: "<connector name>", query: QUERY }); // the DAX it was generated on
|
|
639
659
|
const options = useBicChartOptions();
|
|
640
660
|
const country = useBicFilter("CountryIso3", { label: "Country", display: "CountryName" }); // step 6
|
|
641
661
|
<BicChartPanel result={result}>
|
|
@@ -732,7 +752,7 @@ import FORECAST_DAX from "@/queries/overview/bookings-forecast.dax?raw";
|
|
|
732
752
|
const country = useBicFilter("CountryIso3", { label: "Country", display: "CountryName" });
|
|
733
753
|
const route = useBicFilter(["OriginCode", "DestinationCode"],
|
|
734
754
|
{ label: "Route", display: ["OriginName", "DestinationName"] });
|
|
735
|
-
const forecast = useSemanticModelQuery({ connection: "<
|
|
755
|
+
const forecast = useSemanticModelQuery({ connection: "<connector name>",
|
|
736
756
|
query: filterQuery(FORECAST_DAX, treatAs(country, "Geography[CountryIso3]")) });
|
|
737
757
|
|
|
738
758
|
<BicFilterChips /> {/* "Country: Japan ×" - what's filtered, and its clear */}
|
|
@@ -799,8 +819,10 @@ npx rayfin init --services auth,data --auth-methods fabric --dialect mssql --ove
|
|
|
799
819
|
Each flag is needed: without `--overwrite` it prints "Initialization cancelled" and exits 0 with no
|
|
800
820
|
reason; without `--project-name` (pass the `id:` already in `rayfin/rayfin.yml`, so nothing is renamed)
|
|
801
821
|
it stops with "--project-name is required in non-interactive mode". It rewrites `rayfin/rayfin.yml`
|
|
802
|
-
and `.gitignore`, so `git diff` both and put back what's yours
|
|
803
|
-
`
|
|
822
|
+
and `.gitignore`, so `git diff` both and put back what's yours: on the template's connector layout that is the
|
|
823
|
+
`connectors:` list in `rayfin/rayfin.yml` (put it back, or run the same `npx rayfin connector add` again - without it
|
|
824
|
+
the app and `query_semantic_model` have no model) and the template's `.gitignore` lines; on the older layout, on 1.36.1, it
|
|
825
|
+
dropped the `src/fabric.generated.ts` line. It writes `rayfin/tsconfig.json` - keep its
|
|
804
826
|
`outDir`, `.temp/compiled`, which is where the deploy reads the entities from - and no entities. On 1.36.2 it
|
|
805
827
|
writes no `rayfin/data/schema.ts` either: don't write one by hand - `setup_fabric_app` with `features` (step c) writes it
|
|
806
828
|
when `rayfin/rayfin.yml` shows the data service on.
|
|
@@ -809,9 +831,11 @@ when `rayfin/rayfin.yml` shows the data service on.
|
|
|
809
831
|
- `rayfin/tsconfig.json`, in `compilerOptions`: `"tsBuildInfoFile": ".temp/tsconfig.tsbuildinfo"` and
|
|
810
832
|
`"allowImportingTsExtensions": false` (it inherits both from the root: TS6377 and TS5096 otherwise).
|
|
811
833
|
- the root `tsconfig.json`: `"references": [{ "path": "./rayfin" }]`.
|
|
812
|
-
- type the client with your schema
|
|
813
|
-
|
|
814
|
-
`
|
|
834
|
+
- type the client with your schema (`import type { AppSchema } from "../../rayfin/data/schema";`): in
|
|
835
|
+
`src/lib/rayfin-client.ts`, on the connector layout, `AppSchema` in place of `EntitySchema` as the first type argument
|
|
836
|
+
of `ConnectorsRayfinClient<EntitySchema, FunctionsSchema, AppConnectorsSchema>` (the older layout's file has
|
|
837
|
+
`RayfinClient<AppSchema>`); and `RayfinClient<AppSchema>` in the constructor of `src/services/rayfin-auth.service.ts`
|
|
838
|
+
(TS2345 otherwise).
|
|
815
839
|
|
|
816
840
|
Check with `npx tsc -b`; a bare `tsc --noEmit` reports TS6305 until the `rayfin/` project is built. If a
|
|
817
841
|
TS2345 names two copies of `rayfin-auth`, something installed only some Rayfin packages: run
|