@intellara/trovegen-mcp 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/NOTICE ADDED
@@ -0,0 +1,27 @@
1
+ troveGEN MCP Server
2
+ Copyright 2026 Intellara Technologies Private Limited
3
+
4
+ This product is licensed under the Apache License, Version 2.0 (the
5
+ "License"). You may obtain a copy of the License in the LICENSE file
6
+ distributed with this package, or at:
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ TRADEMARKS
11
+ ----------
12
+ "troveGEN", "TROVE-Z", "troveGEN-Z", "Intellara" and the associated logos are
13
+ trademarks of Intellara Technologies Private Limited. The Apache License does
14
+ not grant permission to use these marks (see section 6 of the License).
15
+
16
+ You may state that your product works with, connects to, or is built on
17
+ troveGEN. You may not use these marks in a way that suggests endorsement,
18
+ affiliation, or that your product is an official Intellara distribution, and
19
+ you may not use them as the name of a fork or derivative work.
20
+
21
+ SCOPE OF THIS LICENCE
22
+ ---------------------
23
+ This Apache-2.0 licence applies ONLY to this client package. It does not apply
24
+ to the troveGEN platform (the ingestion pipeline, retrieval engine, API server
25
+ and console), which is proprietary software licensed separately under a
26
+ commercial agreement. Access to a running troveGEN deployment is governed by
27
+ that agreement, not by this file.
package/README.md CHANGED
@@ -1,3 +1,73 @@
1
- # Temporary Holding Version
1
+ # @intellara/trovegen-mcp
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An [MCP](https://modelcontextprotocol.io) server that turns a [troveGEN](https://trovegen.com)
4
+ project into native tools for Claude, Cursor, and any MCP-capable agent — search,
5
+ grounded Q&A, and exact table computation, all scoped by the API key you give it.
6
+
7
+ ## Setup
8
+
9
+ ```json
10
+ {
11
+ "mcpServers": {
12
+ "trovegen": {
13
+ "command": "npx",
14
+ "args": ["trovegen-mcp"],
15
+ "env": {
16
+ "TROVEGEN_API_KEY": "trv_...",
17
+ "TROVEGEN_PROJECT": "<project-id-or-slug>"
18
+ }
19
+ }
20
+ }
21
+ }
22
+ ```
23
+
24
+ `TROVEGEN_PROJECT` is optional — pin it to skip passing a project id on every call, or omit
25
+ it and let the agent choose from `trovegen_list_projects`.
26
+
27
+ ## Tools
28
+
29
+ | Tool | What it does |
30
+ | --- | --- |
31
+ | `trovegen_search` | Hybrid semantic + keyword search. Returns ranked passages with scores and metadata. |
32
+ | `trovegen_ask` | A synthesized, cited answer — or an exact computed value for aggregate questions over document tables. Requires the tenant's optional generation API to be enabled (`GENERATION_DISABLED` error otherwise). |
33
+ | `trovegen_compute_table` | Exact aggregates (sum, average, count, min, max) over extracted document tables. |
34
+ | `trovegen_list_projects` | List projects visible to the API key (omitted when `TROVEGEN_PROJECT` is pinned). |
35
+ | `trovegen_list_documents` | List documents in a project. |
36
+ | `trovegen_ingest_text` | Add a text document — **write access, off by default.** |
37
+
38
+ ## Environment variables
39
+
40
+ | Variable | Purpose |
41
+ | --- | --- |
42
+ | `TROVEGEN_API_KEY` | Required. A troveGEN API key (`trv_...`). Scopes on the key bound what the agent can do. |
43
+ | `TROVEGEN_API_URL` | Deployment origin. Default `http://localhost:4000`. Point at the managed service, a self-hosted install, or an air-gapped one. |
44
+ | `TROVEGEN_PROJECT` | Optional project id/slug to pin. |
45
+ | `TROVEGEN_ALLOW_WRITE` | Set to `true` to expose `trovegen_ingest_text`. Read-only by default — an agent holding a read-only key physically cannot write. |
46
+
47
+ ## Security model
48
+
49
+ This server is a plain client of the public troveGEN API — it has no privileged access path.
50
+ Every call goes through the same auth, scopes, entitlements, and rate limits a direct API
51
+ call would. An agent can never do more than the API key you hand it allows.
52
+
53
+ ### Scopes each tool needs
54
+
55
+ | Tool | Key scope |
56
+ | --- | --- |
57
+ | `trovegen_ask`, `trovegen_search`, `trovegen_compute_table` | `search:read` |
58
+ | `trovegen_list_entities` | `search:read` or `pipeline:read` |
59
+ | `trovegen_list_documents` | `pipeline:read` |
60
+ | `trovegen_ingest_text` | `pipeline:write` |
61
+ | `trovegen_list_projects` | any key |
62
+
63
+ A call the key's scopes do not allow fails with `KEY_SCOPE_FORBIDDEN`. The key's plan also applies: a scope never unlocks a feature the workspace plan does not include.
64
+
65
+ ## License
66
+
67
+ Apache License 2.0 — Copyright 2026 Intellara Technologies Private Limited.
68
+ See [LICENSE](./LICENSE) and [NOTICE](./NOTICE).
69
+
70
+ This licence covers **this client package only**. The troveGEN platform it
71
+ connects to is proprietary and licensed separately; using this client does not
72
+ grant any right to the platform. "troveGEN" and "Intellara" are trademarks —
73
+ Apache-2.0 grants no rights to them (section 6).
package/dist/index.js ADDED
@@ -0,0 +1,260 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * troveGEN MCP server — troveGEN as a native tool for MCP-capable agents
4
+ * (Claude, IDE copilots, any Model Context Protocol client).
5
+ *
6
+ * npx trovegen-mcp
7
+ *
8
+ * Env:
9
+ * TROVEGEN_API_KEY required — a `trv_` API key; its scopes bound the tools
10
+ * TROVEGEN_API_URL deployment origin (default http://localhost:4000);
11
+ * point at self-hosted / air-gapped troveGEN freely
12
+ * TROVEGEN_PROJECT optional project id/slug pin; when set, tools omit
13
+ * the projectId argument and cannot reach other projects
14
+ * TROVEGEN_ALLOW_WRITE 'true' to expose ingestion — default read-only, the
15
+ * safe posture for agent use
16
+ *
17
+ * The server is a plain client of the public API: auth, tenant isolation,
18
+ * entitlements and rate limits all apply exactly as they would to any caller.
19
+ */
20
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
21
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
22
+ import { z } from 'zod';
23
+ import { TroveGenClient, TroveGenError } from '@intellara/trovegen-sdk';
24
+ const API_KEY = process.env.TROVEGEN_API_KEY ?? '';
25
+ const API_URL = process.env.TROVEGEN_API_URL ?? 'http://localhost:4000';
26
+ const PINNED_PROJECT = process.env.TROVEGEN_PROJECT || undefined;
27
+ const ALLOW_WRITE = process.env.TROVEGEN_ALLOW_WRITE === 'true';
28
+ if (!API_KEY) {
29
+ console.error('trovegen-mcp: set TROVEGEN_API_KEY (create one in the troveGEN dashboard → API keys)');
30
+ process.exit(1);
31
+ }
32
+ const trovegen = new TroveGenClient({ apiKey: API_KEY, baseUrl: API_URL });
33
+ const server = new McpServer({ name: 'trovegen', version: '0.1.2' });
34
+ /** Project argument — ignored when the server is pinned via TROVEGEN_PROJECT. */
35
+ const projectArg = {
36
+ projectId: z
37
+ .string()
38
+ .optional()
39
+ .describe(PINNED_PROJECT
40
+ ? 'Ignored — this server is pinned to a project'
41
+ : 'Project id (list with trovegen_list_projects)'),
42
+ };
43
+ const resolveProject = (args) => {
44
+ const id = PINNED_PROJECT ?? args.projectId;
45
+ if (!id)
46
+ throw new Error('projectId is required (or pin one via TROVEGEN_PROJECT)');
47
+ return id;
48
+ };
49
+ const filterArg = z
50
+ .record(z.unknown())
51
+ .optional()
52
+ .describe('Optional metadata filter: {"field":"value"} equality, {"field":{"$gte":2024}} comparisons, {"$or":[…]} groups');
53
+ // Retrieval-tuning args shared by trovegen_search and trovegen_ask — the same
54
+ // knobs the API and the dashboard playground expose, so an MCP caller isn't
55
+ // stuck on defaults the console user can freely tune.
56
+ const rerankArg = z
57
+ .enum(['none', 'llm', 'cohere', 'tei'])
58
+ .optional()
59
+ .describe('Cross-encoder rerank of the top candidates. "tei" (self-hosted BGE) is the keyless default option.');
60
+ const expandArg = z
61
+ .enum(['none', 'neighbors', 'section', 'parent', 'entity', 'graph'])
62
+ .optional()
63
+ .describe('Stitch related chunks into one window so a fact split across chunks comes back whole: ' +
64
+ 'neighbors=adjacent chunks, section=whole section, parent=small-to-big parent group, ' +
65
+ 'entity=chunks sharing an entity, graph=chunks about related entities.');
66
+ const expandWindowArg = z.number().int().min(0).max(5).optional().describe("Neighbours per side when expand='neighbors'.");
67
+ const hydeArg = z.boolean().optional().describe('HyDE: embed a generated hypothetical answer alongside the query.');
68
+ const graphHopsArg = z.number().int().min(1).max(3).optional().describe("Edge hops when expand='graph' (1=direct neighbours).");
69
+ const recencyBiasArg = z.boolean().optional().describe('Boost newer documents after relevance ranking (opt-in, off by default).');
70
+ const recencyHalfLifeDaysArg = z
71
+ .number()
72
+ .int()
73
+ .min(1)
74
+ .max(3650)
75
+ .optional()
76
+ .describe('Half-life in days for recencyBias — a document this old counts half as fresh.');
77
+ function text(content) {
78
+ return { content: [{ type: 'text', text: content }] };
79
+ }
80
+ function errorText(err) {
81
+ const message = err instanceof TroveGenError
82
+ ? `troveGEN error ${err.code}: ${err.message}${err.requestId ? ` (request ${err.requestId})` : ''}`
83
+ : err instanceof Error
84
+ ? err.message
85
+ : String(err);
86
+ return { content: [{ type: 'text', text: message }], isError: true };
87
+ }
88
+ server.tool('trovegen_ask', 'Ask a question of the knowledge base and get a grounded answer with verifiable citations. ' +
89
+ 'Numeric/aggregate questions over document tables are computed exactly. ' +
90
+ 'Refuses honestly when the corpus cannot answer.', {
91
+ ...projectArg,
92
+ query: z.string().describe('The question'),
93
+ filter: filterArg,
94
+ retrievalMode: z
95
+ .enum(['vector', 'keyword', 'hybrid'])
96
+ .optional()
97
+ .describe('The underlying hybrid-search strategy (default: project setting, usually hybrid).'),
98
+ rerank: rerankArg,
99
+ minScore: z.number().min(0).max(1).optional().describe('Relevance floor; passages below it are not used as evidence.'),
100
+ expand: expandArg,
101
+ expandWindow: expandWindowArg,
102
+ hyde: hydeArg,
103
+ graphHops: graphHopsArg,
104
+ recencyBias: recencyBiasArg,
105
+ recencyHalfLifeDays: recencyHalfLifeDaysArg,
106
+ }, async (args) => {
107
+ try {
108
+ const res = await trovegen.ask(resolveProject(args), {
109
+ query: args.query,
110
+ filter: args.filter,
111
+ retrievalMode: args.retrievalMode,
112
+ rerank: args.rerank,
113
+ minScore: args.minScore,
114
+ expand: args.expand,
115
+ expandWindow: args.expandWindow,
116
+ hyde: args.hyde,
117
+ graphHops: args.graphHops,
118
+ recencyBias: args.recencyBias,
119
+ recencyHalfLifeDays: args.recencyHalfLifeDays,
120
+ });
121
+ if (res.engine === 'deterministic' || res.engine === 'llm-sql') {
122
+ return text(`${res.answer ?? '(no phrase)'}\n\n[computed exactly from an extracted document table${res.sql ? `; SQL: ${res.sql}` : ''}]`);
123
+ }
124
+ if (res.refused) {
125
+ return text('The knowledge base does not contain the information needed to answer this question.');
126
+ }
127
+ if (res.engine === 'generated' && res.answer) {
128
+ const sources = (res.citations ?? [])
129
+ .map((c) => `[${c.marker}] doc ${c.documentId} chunk ${c.chunkIndex} (score ${c.score}): ${c.text.slice(0, 200)}`)
130
+ .join('\n');
131
+ return text(`${res.answer}\n\nSources:\n${sources}`);
132
+ }
133
+ // Retrieval-only deployment (no chat model configured server-side).
134
+ const chunks = (res.results ?? []).map((r, i) => `[${i + 1}] ${r.content}`).join('\n\n');
135
+ return text(`No generation model is configured; most relevant passages:\n\n${chunks}`);
136
+ }
137
+ catch (err) {
138
+ return errorText(err);
139
+ }
140
+ });
141
+ server.tool('trovegen_search', 'Hybrid semantic + keyword search over the knowledge base. Returns ranked passages with scores and metadata. ' +
142
+ 'Use trovegen_ask instead when you want a synthesized answer.', {
143
+ ...projectArg,
144
+ query: z.string().describe('Search query'),
145
+ topK: z.number().int().min(1).max(20).optional().describe('Results to return (default 5)'),
146
+ mode: z.enum(['vector', 'keyword', 'hybrid']).optional().describe('vector=semantic only, keyword=BM25 only, hybrid=fused (default).'),
147
+ filter: filterArg,
148
+ rerank: rerankArg,
149
+ minScore: z.number().min(0).max(1).optional().describe('Relevance floor; results below it are dropped.'),
150
+ expand: expandArg,
151
+ expandWindow: expandWindowArg,
152
+ hyde: hydeArg,
153
+ graphHops: graphHopsArg,
154
+ recencyBias: recencyBiasArg,
155
+ recencyHalfLifeDays: recencyHalfLifeDaysArg,
156
+ }, async (args) => {
157
+ try {
158
+ const res = await trovegen.search(resolveProject(args), {
159
+ query: args.query,
160
+ topK: args.topK ?? 5,
161
+ mode: args.mode,
162
+ filter: args.filter,
163
+ rerank: args.rerank,
164
+ minScore: args.minScore,
165
+ expand: args.expand,
166
+ expandWindow: args.expandWindow,
167
+ hyde: args.hyde,
168
+ graphHops: args.graphHops,
169
+ recencyBias: args.recencyBias,
170
+ recencyHalfLifeDays: args.recencyHalfLifeDays,
171
+ });
172
+ if (res.results.length === 0)
173
+ return text('No passages matched.');
174
+ const pipelineNote = [
175
+ res.pipeline.rerankApplied ? `reranked by ${res.pipeline.reranker}` : null,
176
+ res.pipeline.expand && res.pipeline.expand !== 'none' ? `expand=${res.pipeline.expand} (${res.pipeline.expandedResults ?? 0} expanded)` : null,
177
+ res.pipeline.recencyBias ? `recency-biased (${res.pipeline.recencyHalfLifeDays}d half-life)` : null,
178
+ ]
179
+ .filter(Boolean)
180
+ .join(', ');
181
+ return text(res.results
182
+ .map((r, i) => `[${i + 1}] (score ${r.score}) doc ${r.documentId} chunk ${r.chunkIndex}\n${r.content}`)
183
+ .join('\n\n') + (pipelineNote ? `\n\n[${pipelineNote}]` : ''));
184
+ }
185
+ catch (err) {
186
+ return errorText(err);
187
+ }
188
+ });
189
+ server.tool('trovegen_list_entities', 'List entities extracted from the knowledge base (people/orgs/products/etc. mentioned across documents), ' +
190
+ 'ranked by mention count. Requires the project to have entity extraction enabled at ingest ' +
191
+ '(chunkingConfig.graphMode); returns an empty list otherwise.', { ...projectArg, limit: z.number().int().min(1).max(500).optional().describe('Max entities to return (default 100)') }, async (args) => {
192
+ try {
193
+ const entities = await trovegen.entities.list(resolveProject(args), args.limit ?? 100);
194
+ if (entities.length === 0) {
195
+ return text('No entities found — the project may have entity extraction (chunkingConfig.graphMode) turned off.');
196
+ }
197
+ return text(entities.map((e) => `${e.name} (${e.type}) — ${e.mentionCount} mention(s)`).join('\n'));
198
+ }
199
+ catch (err) {
200
+ return errorText(err);
201
+ }
202
+ });
203
+ server.tool('trovegen_compute_table', 'Compute an exact aggregate (sum, average, count, min, max — with optional filters) over tables extracted ' +
204
+ 'from the documents. Returns exact numbers, never estimates. Use for quantitative questions about tabular data.', { ...projectArg, query: z.string().describe('The quantitative question, e.g. "total revenue for Q3"') }, async (args) => {
205
+ try {
206
+ const res = await trovegen.ask(resolveProject(args), { query: args.query, mode: 'table' });
207
+ if (res.engine === 'none' || res.answer == null) {
208
+ return text(res.note ?? 'No extracted table can answer this question.');
209
+ }
210
+ return text(`${res.answer}${res.sql ? `\n\n[SQL: ${res.sql}]` : ''}`);
211
+ }
212
+ catch (err) {
213
+ return errorText(err);
214
+ }
215
+ });
216
+ if (!PINNED_PROJECT) {
217
+ server.tool('trovegen_list_projects', 'List the knowledge-base projects available to this API key.', async () => {
218
+ try {
219
+ const projects = await trovegen.projects.list();
220
+ return text(projects.map((p) => `${p.id} ${p.name} (${p.mode}, ${p.status})`).join('\n') || 'No projects.');
221
+ }
222
+ catch (err) {
223
+ return errorText(err);
224
+ }
225
+ });
226
+ }
227
+ server.tool('trovegen_list_documents', 'List documents in a project (id, title, status, chunk count).', { ...projectArg }, async (args) => {
228
+ try {
229
+ const docs = await trovegen.documents.list(resolveProject(args));
230
+ return text(docs.map((d) => `${d.id} ${d.title ?? '(untitled)'} [${d.status}, ${d.chunkCount} chunks]`).join('\n') ||
231
+ 'No documents.');
232
+ }
233
+ catch (err) {
234
+ return errorText(err);
235
+ }
236
+ });
237
+ if (ALLOW_WRITE) {
238
+ server.tool('trovegen_ingest_text', 'Add a text document to the knowledge base (write access — enabled via TROVEGEN_ALLOW_WRITE).', {
239
+ ...projectArg,
240
+ title: z.string().optional().describe('Document title'),
241
+ text: z.string().describe('Document content'),
242
+ metadata: z.record(z.unknown()).optional().describe('Metadata for later filtering'),
243
+ }, async (args) => {
244
+ try {
245
+ const doc = await trovegen.documents.ingestText(resolveProject(args), {
246
+ title: args.title,
247
+ text: args.text,
248
+ metadata: args.metadata,
249
+ });
250
+ return text(`Ingested "${doc.title ?? doc.id}": ${doc.chunkCount} chunk(s), status ${doc.status}.`);
251
+ }
252
+ catch (err) {
253
+ return errorText(err);
254
+ }
255
+ });
256
+ }
257
+ const transport = new StdioServerTransport();
258
+ await server.connect(transport);
259
+ console.error(`trovegen-mcp ready — ${API_URL}${PINNED_PROJECT ? ` (project ${PINNED_PROJECT})` : ''}${ALLOW_WRITE ? ' [write enabled]' : ' [read-only]'}`);
260
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,aAAa,EAAoB,MAAM,yBAAyB,CAAC;AAE1F,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC;AACnD,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,uBAAuB,CAAC;AACxE,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,SAAS,CAAC;AACjE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,MAAM,CAAC;AAEhE,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,sFAAsF,CAAC,CAAC;IACtG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;AAE3E,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,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E,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,IAAI,CAAC,QAA+C;aAC/D,CAAC,CAAC;YACH,OAAO,IAAI,CAAC,aAAa,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,UAAU,qBAAqB,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;QACtG,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAChC,OAAO,CAAC,KAAK,CACX,wBAAwB,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,aAAa,cAAc,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,EAAE,CAC7I,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@intellara/trovegen-mcp",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.2",
4
+ "description": "MCP server for troveGEN — gives any MCP-capable agent grounded, cited answers, hybrid search, and exact table computation over troveGEN knowledge bases.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://trovegen.com",
7
+ "author": "Intellara Technologies Private Limited",
8
+ "keywords": [
9
+ "mcp",
10
+ "model-context-protocol",
11
+ "rag",
12
+ "ai-agents",
13
+ "trovegen"
14
+ ],
15
+ "type": "module",
16
+ "main": "dist/index.js",
17
+ "bin": {
18
+ "trovegen-mcp": "dist/index.js"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md",
23
+ "LICENSE",
24
+ "NOTICE"
25
+ ],
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "engines": {
30
+ "node": ">=18"
31
+ },
32
+ "dependencies": {
33
+ "@modelcontextprotocol/sdk": "^1.32.1",
34
+ "zod": "^3.25.76",
35
+ "@intellara/trovegen-sdk": "0.1.2"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^24.19.1",
39
+ "typescript": "^5.9.3"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "type-check": "tsc --noEmit"
44
+ }
6
45
  }