infranodus-mcp-server 1.6.1 → 1.7.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.
- package/README.md +31 -36
- package/bin/infranodus-mcp-server.js +7 -53
- package/bin/keywordgraph-mcp-server.js +8 -0
- package/bin/mcp-server.js +56 -0
- package/dist/api/client.d.ts.map +1 -1
- package/dist/api/client.js +2 -1
- package/dist/api/client.js.map +1 -1
- package/dist/api/config-store.d.ts.map +1 -1
- package/dist/api/config-store.js +3 -2
- package/dist/api/config-store.js.map +1 -1
- package/dist/auth/oauth-provider.d.ts +3 -3
- package/dist/auth/oauth-provider.d.ts.map +1 -1
- package/dist/auth/oauth-provider.js +7 -6
- package/dist/auth/oauth-provider.js.map +1 -1
- package/dist/config/brand.d.ts +71 -0
- package/dist/config/brand.d.ts.map +1 -0
- package/dist/config/brand.js +118 -0
- package/dist/config/brand.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +7 -5
- package/dist/config/index.js.map +1 -1
- package/dist/http-server.d.ts +1 -1
- package/dist/http-server.js +17 -16
- package/dist/http-server.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -33
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/instructions.d.ts.map +1 -1
- package/dist/instructions.js +3 -2
- package/dist/instructions.js.map +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +10 -9
- package/dist/prompts/index.js.map +1 -1
- package/dist/resources/about.d.ts.map +1 -1
- package/dist/resources/about.js +28 -35
- package/dist/resources/about.js.map +1 -1
- package/dist/resources/llms-txt.d.ts.map +1 -1
- package/dist/resources/llms-txt.js +21 -10
- package/dist/resources/llms-txt.js.map +1 -1
- package/dist/schemas/index.d.ts +122 -21
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +192 -21
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/addMemory.d.ts.map +1 -1
- package/dist/tools/addMemory.js +3 -2
- package/dist/tools/addMemory.js.map +1 -1
- package/dist/tools/analyzeExistingGraph.d.ts.map +1 -1
- package/dist/tools/analyzeExistingGraph.js +3 -2
- package/dist/tools/analyzeExistingGraph.js.map +1 -1
- package/dist/tools/analyzeLlmResults.d.ts +37 -0
- package/dist/tools/analyzeLlmResults.d.ts.map +1 -0
- package/dist/tools/analyzeLlmResults.js +192 -0
- package/dist/tools/analyzeLlmResults.js.map +1 -0
- package/dist/tools/analyzeText.d.ts.map +1 -1
- package/dist/tools/analyzeText.js +2 -1
- package/dist/tools/analyzeText.js.map +1 -1
- package/dist/tools/createKnowledgeGraph.d.ts.map +1 -1
- package/dist/tools/createKnowledgeGraph.js +3 -2
- package/dist/tools/createKnowledgeGraph.js.map +1 -1
- package/dist/tools/generateDifferenceGraphFromTexts.d.ts.map +1 -1
- package/dist/tools/generateDifferenceGraphFromTexts.js +2 -1
- package/dist/tools/generateDifferenceGraphFromTexts.js.map +1 -1
- package/dist/tools/generateMergedGraphFromTexts.d.ts.map +1 -1
- package/dist/tools/generateMergedGraphFromTexts.js +2 -1
- package/dist/tools/generateMergedGraphFromTexts.js.map +1 -1
- package/dist/tools/generateOntologyGraph.d.ts +36 -0
- package/dist/tools/generateOntologyGraph.d.ts.map +1 -0
- package/dist/tools/generateOntologyGraph.js +194 -0
- package/dist/tools/generateOntologyGraph.js.map +1 -0
- package/dist/tools/generateResponses.d.ts.map +1 -1
- package/dist/tools/generateResponses.js +2 -1
- package/dist/tools/generateResponses.js.map +1 -1
- package/dist/tools/generateTopicalClusters.d.ts +1 -0
- package/dist/tools/generateTopicalClusters.d.ts.map +1 -1
- package/dist/tools/generateTopicalClusters.js +36 -1
- package/dist/tools/generateTopicalClusters.js.map +1 -1
- package/dist/tools/generateYoutubeSearchResultsGraph.d.ts +42 -0
- package/dist/tools/generateYoutubeSearchResultsGraph.d.ts.map +1 -0
- package/dist/tools/generateYoutubeSearchResultsGraph.js +97 -0
- package/dist/tools/generateYoutubeSearchResultsGraph.js.map +1 -0
- package/dist/tools/getMemory.d.ts.map +1 -1
- package/dist/tools/getMemory.js +3 -2
- package/dist/tools/getMemory.js.map +1 -1
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/listGraphs.d.ts.map +1 -1
- package/dist/tools/listGraphs.js +2 -1
- package/dist/tools/listGraphs.js.map +1 -1
- package/dist/tools/retrieveContextForPromptFromGraph.d.ts.map +1 -1
- package/dist/tools/retrieveContextForPromptFromGraph.js +3 -2
- package/dist/tools/retrieveContextForPromptFromGraph.js.map +1 -1
- package/dist/tools/searchGraphs.d.ts.map +1 -1
- package/dist/tools/searchGraphs.js +3 -2
- package/dist/tools/searchGraphs.js.map +1 -1
- package/dist/tools/searchGraphsFetch.d.ts.map +1 -1
- package/dist/tools/searchGraphsFetch.js +2 -1
- package/dist/tools/searchGraphsFetch.js.map +1 -1
- package/dist/types/index.d.ts +39 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/transformers.d.ts +3 -1
- package/dist/utils/transformers.d.ts.map +1 -1
- package/dist/utils/transformers.js +36 -1
- package/dist/utils/transformers.js.map +1 -1
- package/dist/utils/urlContent.d.ts +1 -1
- package/dist/utils/urlContent.js +1 -1
- package/llms-full.infranodus.txt +469 -0
- package/llms-full.keywordgraph.txt +469 -0
- package/llms.infranodus.txt +64 -0
- package/llms.keywordgraph.txt +64 -0
- package/package.json +14 -3
package/README.md
CHANGED
|
@@ -21,7 +21,6 @@ InfraNodus MCP Server enables LLM workflows and AI assistants to analyze text us
|
|
|
21
21
|
### Available Tools
|
|
22
22
|
|
|
23
23
|
1. **generate_knowledge_graph**
|
|
24
|
-
|
|
25
24
|
- Convert any text into a visual knowledge graph
|
|
26
25
|
- Extract topics, concepts, and their relationships
|
|
27
26
|
- Identify structural patterns and clusters
|
|
@@ -29,52 +28,45 @@ InfraNodus MCP Server enables LLM workflows and AI assistants to analyze text us
|
|
|
29
28
|
- Perform entity detection for cleaner graphs
|
|
30
29
|
|
|
31
30
|
2. **analyze_existing_graph_by_name**
|
|
32
|
-
|
|
33
31
|
- Retrieve and analyze existing graphs from your InfraNodus account
|
|
34
32
|
- Access previously saved analyses
|
|
35
33
|
- Export graph data with full statistics
|
|
36
34
|
|
|
37
35
|
3. **analyze_text**
|
|
38
|
-
|
|
39
36
|
- Analyze a text, URL, or YouTube transcript
|
|
40
37
|
- Extract and analyze a graph from text or URL; provide either text or url
|
|
41
38
|
- Get topics, clusters, statements, graph structure, and AI summary as requested
|
|
42
39
|
|
|
43
40
|
4. **generate_content_gaps**
|
|
44
|
-
|
|
45
41
|
- Detect missing connections in discourse
|
|
46
42
|
- Identify underexplored topics
|
|
47
43
|
- Generate research questions
|
|
48
44
|
- Suggest content development opportunities
|
|
49
45
|
|
|
50
46
|
5. **generate_topical_clusters**
|
|
51
|
-
|
|
52
47
|
- Generate topics and clusters of keywords from text using knowledge graph analysis
|
|
53
48
|
- Make sure to beyond genetic insights and detect smaller topics
|
|
54
49
|
- Use the topical clusters to establish topical authority for SEO
|
|
50
|
+
- Returns AI-generated overviews of the topical clusters (`topicalClusterSummaries`), summarizing the discourse each cluster represents — useful for SEO-optimized content creation. Enabled by default; set `generateTopicalSummaries: false` to increase processing speed or if the summary request fails
|
|
55
51
|
|
|
56
52
|
6. **generate_contextual_hint**
|
|
57
|
-
|
|
58
53
|
- Generate a topical overview of a text and provide insights for LLMs to generate better responses
|
|
59
54
|
- Use it to get a high-level understanding of a text
|
|
60
55
|
- Use it to augment prompts in your LLM workflows and AI assistants
|
|
61
56
|
|
|
62
57
|
7. **generate_research_questions**
|
|
63
|
-
|
|
64
58
|
- Generate research questions that bridge content gaps from text, URL, or an existing InfraNodus graph
|
|
65
59
|
- Use them as prompts in your LLM models and AI workflows
|
|
66
60
|
- Use any AI model (included in InfraNodus API)
|
|
67
61
|
- Content gaps are identified based on topical clustering
|
|
68
62
|
|
|
69
63
|
8. **generate_research_ideas**
|
|
70
|
-
|
|
71
64
|
- Generate innovative research ideas based on content gaps identified in the text
|
|
72
65
|
- Get actionable ideas to improve the text and develop the discourse
|
|
73
66
|
- Use any AI model (included in InfraNodus API)
|
|
74
67
|
- Ideas are generated from gaps between topical clusters
|
|
75
68
|
|
|
76
69
|
9. **optimize_text_structure**
|
|
77
|
-
|
|
78
70
|
- Analyze the level of bias and coherence in text using knowledge graph analysis
|
|
79
71
|
- If the text is too biased, develop the represented topics to balance the discourse
|
|
80
72
|
- If the text is focused or diversified, develop the content gaps to deepen the analysis
|
|
@@ -82,28 +74,24 @@ InfraNodus MCP Server enables LLM workflows and AI assistants to analyze text us
|
|
|
82
74
|
- Choose response type: response, idea, question, or transcend
|
|
83
75
|
|
|
84
76
|
10. **generate_responses_from_graph**
|
|
85
|
-
|
|
86
77
|
- Generate responses based on an existing InfraNodus graph
|
|
87
78
|
- Integrate them into your LLM workflows and AI assistants
|
|
88
79
|
- Use any AI model (included in InfraNodus API)
|
|
89
80
|
- Use any prompt
|
|
90
81
|
|
|
91
82
|
11. **develop_conceptual_bridges**
|
|
92
|
-
|
|
93
83
|
- Analyze text and develop latent ideas based on concepts that connect this text to a broader discourse
|
|
94
84
|
- Discover hidden themes and patterns that link your text to wider contexts
|
|
95
85
|
- Use any AI model (included in InfraNodus API)
|
|
96
86
|
- Generate insights that help develop the discourse
|
|
97
87
|
|
|
98
88
|
12. **develop_latent_topics**
|
|
99
|
-
|
|
100
89
|
- Analyze text and extract underdeveloped topics with ideas on how to develop them
|
|
101
90
|
- Identify topics that need more attention and elaboration
|
|
102
91
|
- Use any AI model (included in InfraNodus API)
|
|
103
92
|
- Get actionable suggestions for content expansion
|
|
104
93
|
|
|
105
94
|
13. **develop_text_tool**
|
|
106
|
-
|
|
107
95
|
- Comprehensive text analysis combining content gap ideas, latent topics, and conceptual bridges
|
|
108
96
|
- Executes multiple analyses in sequence with progress tracking
|
|
109
97
|
- Generates research ideas based on content gaps
|
|
@@ -111,79 +99,85 @@ InfraNodus MCP Server enables LLM workflows and AI assistants to analyze text us
|
|
|
111
99
|
- Finds content gaps for deeper exploration
|
|
112
100
|
|
|
113
101
|
14. **create_knowledge_graph**
|
|
114
|
-
|
|
115
102
|
- Create a knowledge graph in InfraNodus from text and provide a link to it
|
|
116
103
|
- Use it to create a knowledge graph in InfraNodus from text
|
|
117
104
|
|
|
118
|
-
15. **
|
|
105
|
+
15. **generate_ontology_graph**
|
|
106
|
+
- Use AI to generate a reasoning ontology graph (entities and the relations between them) from a topic, prompt, or text — e.g. "build an ontology on AI attention mechanisms"
|
|
107
|
+
- Saved as a persistent InfraNodus graph by default and a link is returned; set `saveGraph: false` if the user asks not to save, or when you only need a one-off AI ontology overview of a topic for the current context that won't be reused later (the generated statements are returned directly without persisting)
|
|
108
|
+
- `modelToUse` defaults to `claude-opus-4.6` for richer ontologies; pick `-mini`/`-lite` variants (or `gpt-4o-mini`) for faster, cheaper generation
|
|
109
|
+
- Returns the compact graph structure (`knowledgeGraph`) and analytics (main topical clusters, content gaps, top influential nodes, top relations, statistics) by default. Set `includeGraph: false` to save context space when only the ontology statements or insights are needed. Set `includeAnalytics: false` if you just need the raw ontology without graph-derived insights — keep it on whenever you want to understand the structure, gaps, or key concepts
|
|
110
|
+
|
|
111
|
+
16. **analyze_llm_results**
|
|
112
|
+
- Ask an LLM to describe a topic and turn its response into a knowledge graph that reveals how the model frames it — main concepts, clusters, content gaps, and the relations between them
|
|
113
|
+
- Use it to probe model bias, surface the implicit structure of an LLM's view on a subject, or compare how different models describe the same topic
|
|
114
|
+
- `modelToUse` defaults to `claude-opus-4.6`; pick the model you actually want to study
|
|
115
|
+
- `modifyAnalyzedText` controls how the LLM output is parsed: `'detectEntities'` (default — mixed entities + words), `'extractEntitiesOnly'` (entity-only graph), or `'none'` (plain co-occurrence)
|
|
116
|
+
- Saves the graph by default; set `saveGraph: false` for a one-off probe. Returns analytics by default and omits the raw graph (`includeGraph: false`) to keep responses compact — enable `includeGraph` when you also need nodes/edges
|
|
119
117
|
|
|
118
|
+
17. **overlap_between_texts**
|
|
120
119
|
- Create knowledge graphs from two or more texts and find the overlap (similarities) between them
|
|
121
120
|
- Use it to find similar topics and keywords across different texts
|
|
122
121
|
|
|
123
|
-
|
|
124
|
-
|
|
122
|
+
18. **merged_graph_from_texts**
|
|
125
123
|
- Build a graph of all the texts and URLs provided, providing topical clusters and gaps present in the merged graph generated from all the texts
|
|
126
124
|
- Use it to combine multiple sources into one graph and see clusters and content gaps across the merged content
|
|
127
125
|
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
19. **difference_between_texts**
|
|
130
127
|
- Compare knowledge graphs from two or more texts and find what's not present in the first graph that's present in the others
|
|
131
128
|
- Use it to find how one text can be enriched with the others
|
|
132
129
|
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
20. **analyze_google_search_results**
|
|
135
131
|
- Generate a graph with keywords and topics for Google search results for a certain query
|
|
136
132
|
- Use it to understand the current informational supply (what people find)
|
|
137
133
|
|
|
138
|
-
|
|
134
|
+
21. **analyze_youtube_results**
|
|
135
|
+
- Generate a graph with keywords and topics from YouTube results for a query, channel, or playlist
|
|
136
|
+
- Choose what to pull via `searchMode`: `search` (video metadata for a search term), `comments` (comments on a video), `channel` (a channel's videos — pass a username, URL, or @handle), `playlist` (a playlist's videos — pass a playlist ID or a URL with `list=`), `subtitles` / `subtitlesChannel` / `subtitlesPlaylist` (transcribed subtitles of a video / channel / playlist), or `searchVideos` (analyzes the content of the videos found — limit hard-capped to 20)
|
|
137
|
+
- Control results with `limit` (default 100, max 2000), `sortBy` (`Popular` / `Oldest` / `Latest`), `excludeDescriptions`, `importLanguage`, and `importRegion`
|
|
138
|
+
- Use it to understand the topics, clusters, and content gaps in the discourse around a video, channel, playlist, or search term on YouTube
|
|
139
139
|
|
|
140
|
+
22. **analyze_related_search_queries**
|
|
140
141
|
- Generate a graph from the search queries suggested by Google for a certain query
|
|
141
142
|
- Use it to understand the current informational demand (what people are looking for)
|
|
142
143
|
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
23. **search_queries_vs_search_results**
|
|
145
145
|
- Generate a graph of keyword combinations and topics people tend to search for that do not readily appear in the search results for the same queries
|
|
146
146
|
- Use it to understand what people search for but don't yet find
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
24. **generate_seo_report**
|
|
150
149
|
- Analyze content for SEO optimization by comparing it with Google search results and search queries
|
|
151
150
|
- Identify content gaps and opportunities for better search visibility
|
|
152
151
|
- Get comprehensive analysis of what's in search results but not in your text
|
|
153
152
|
- Discover what people search for but don't find in current results
|
|
154
153
|
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
25. **memory_add_relations**
|
|
157
155
|
- Add relations to the InfraNodus memory from text
|
|
158
156
|
- Automatically detect entities or use [[wikilinks]] syntax to mark them
|
|
159
157
|
- Save memory to a specified graph name for future retrieval
|
|
160
158
|
- Support automatic entity extraction or manual entity marking
|
|
161
159
|
- Provide links to created memory graphs for easy access
|
|
162
160
|
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
26. **memory_get_relations**
|
|
165
162
|
- Retrieve relations from InfraNodus memory for specific entities
|
|
166
163
|
- Search for entity relations using [[wikilinks]] syntax
|
|
167
164
|
- Query specific memory contexts or search across all memory graphs
|
|
168
165
|
- Extract statements and relationships from stored knowledge graphs
|
|
169
166
|
- Support both entity-specific searches and full context retrieval
|
|
170
167
|
|
|
171
|
-
|
|
172
|
-
|
|
168
|
+
27. **retrieve_from_knowledge_base**
|
|
173
169
|
- Retrieve context from an existing InfraNodus knowledge graph using GraphRAG
|
|
174
170
|
- Query your knowledge base with a natural language prompt to get relevant statements
|
|
175
171
|
- Include graph summaries for quick overviews of the knowledge structure
|
|
176
172
|
- Optionally retrieve the full graph, statements, or extended analysis
|
|
177
173
|
- Ideal for augmenting LLM responses with domain-specific knowledge
|
|
178
174
|
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
28. **search**
|
|
181
176
|
- Search through existing InfraNodus graphs
|
|
182
177
|
- Also use it to search through the public graphs of a specific user
|
|
183
178
|
- Compatible with ChatGPT Deep Research mode via Developer Mode > Connectors
|
|
184
179
|
|
|
185
|
-
|
|
186
|
-
|
|
180
|
+
29. **fetch**
|
|
187
181
|
- Fetch a specific search result for a graph
|
|
188
182
|
- Can be used in ChatGPT Deep Research mode via Developer Mode > Connectors
|
|
189
183
|
|
|
@@ -297,6 +291,7 @@ claude mcp add infranodus -s user \
|
|
|
297
291
|
cd mcp-server-infranodus
|
|
298
292
|
npm install
|
|
299
293
|
npm run build:inspect
|
|
294
|
+
npm run inspect
|
|
300
295
|
```
|
|
301
296
|
|
|
302
297
|
Note that `build:inspect` will generate the `dist/index.js` file which you will then use in your server setup. The standard `npm run build` command will only build a Smithery file.
|
|
@@ -1,54 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// Load environment variables
|
|
10
|
-
dotenv.config();
|
|
11
|
-
|
|
12
|
-
const config = {
|
|
13
|
-
apiKey: process.env.INFRANODUS_API_KEY || "",
|
|
14
|
-
apiBase: process.env.INFRANODUS_API_BASE || "https://infranodus.com/api/v1",
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
// Validate config
|
|
18
|
-
if (!config.apiKey) {
|
|
19
|
-
console.error(
|
|
20
|
-
"WARNING: Set INFRANODUS_API_KEY in environment variables to ensure you don't hit the rate limit"
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Create server with config
|
|
25
|
-
const server = createServer({ config });
|
|
26
|
-
|
|
27
|
-
// Create STDIO transport
|
|
28
|
-
const transport = new StdioServerTransport();
|
|
29
|
-
|
|
30
|
-
// Handle graceful shutdown
|
|
31
|
-
process.on("SIGINT", async () => {
|
|
32
|
-
await server.close();
|
|
33
|
-
process.exit(0);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
process.on("SIGTERM", async () => {
|
|
37
|
-
await server.close();
|
|
38
|
-
process.exit(0);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
await server.connect(transport);
|
|
43
|
-
// Server is running - no console output to avoid protocol interference
|
|
44
|
-
} catch (error) {
|
|
45
|
-
console.error("ERROR: MCP server failed to connect", error);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Run the main function
|
|
51
|
-
main().catch((error) => {
|
|
52
|
-
console.error("ERROR: Fatal error of MCP server", error);
|
|
53
|
-
process.exit(1);
|
|
54
|
-
});
|
|
2
|
+
// Brand-specific entry for the published `infranodus-mcp-server` package.
|
|
3
|
+
// Bakes in BRAND so `npx infranodus-mcp-server` runs as InfraNodus without
|
|
4
|
+
// the caller needing to set any env var. An explicit BRAND still wins.
|
|
5
|
+
// NOTE: must use dynamic import — a static import would be hoisted and run
|
|
6
|
+
// before this assignment, so brand.js would read BRAND too early.
|
|
7
|
+
process.env.BRAND ||= "infranodus";
|
|
8
|
+
await import("./mcp-server.js");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Brand-specific entry for the published `keywordgraph-mcp-server` package.
|
|
3
|
+
// Bakes in BRAND so `npx keywordgraph-mcp-server` runs as KeywordGraph without
|
|
4
|
+
// the caller needing to set any env var. An explicit BRAND still wins.
|
|
5
|
+
// NOTE: must use dynamic import — a static import would be hoisted and run
|
|
6
|
+
// before this assignment, so brand.js would read BRAND too early.
|
|
7
|
+
process.env.BRAND ||= "keywordgraph";
|
|
8
|
+
await import("./mcp-server.js");
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import * as dotenv from 'dotenv';
|
|
5
|
+
import createServer from '../dist/index.js';
|
|
6
|
+
import { brand, brandApiKey, brandApiBase } from '../dist/config/brand.js';
|
|
7
|
+
|
|
8
|
+
// Main function for CLI execution
|
|
9
|
+
async function main() {
|
|
10
|
+
// Load environment variables
|
|
11
|
+
dotenv.config();
|
|
12
|
+
|
|
13
|
+
// Brand (and thus API env vars / tool set) is selected by the BRAND env var.
|
|
14
|
+
const config = {
|
|
15
|
+
apiKey: brandApiKey(),
|
|
16
|
+
apiBase: brandApiBase(),
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Validate config
|
|
20
|
+
if (!config.apiKey) {
|
|
21
|
+
console.error(
|
|
22
|
+
`WARNING: Set ${brand.envPrefix}_API_KEY in environment variables to ensure you don't hit the rate limit`
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Create server with config
|
|
27
|
+
const server = createServer({ config });
|
|
28
|
+
|
|
29
|
+
// Create STDIO transport
|
|
30
|
+
const transport = new StdioServerTransport();
|
|
31
|
+
|
|
32
|
+
// Handle graceful shutdown
|
|
33
|
+
process.on("SIGINT", async () => {
|
|
34
|
+
await server.close();
|
|
35
|
+
process.exit(0);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
process.on("SIGTERM", async () => {
|
|
39
|
+
await server.close();
|
|
40
|
+
process.exit(0);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
await server.connect(transport);
|
|
45
|
+
// Server is running - no console output to avoid protocol interference
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error("ERROR: MCP server failed to connect", error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Run the main function
|
|
53
|
+
main().catch((error) => {
|
|
54
|
+
console.error("ERROR: Fatal error of MCP server", error);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
});
|
package/dist/api/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIlD,wBAAsB,qBAAqB,CAC1C,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,GAAG,EACT,MAAM,GAAE,MAAe,GACrB,OAAO,CAAC,aAAa,CAAC,CAgCxB"}
|
package/dist/api/client.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { getConfig } from "./config-store.js";
|
|
2
|
+
import { brandSource } from "../config/brand.js";
|
|
2
3
|
export async function makeInfraNodusRequest(endpoint, body, method = "POST") {
|
|
3
4
|
try {
|
|
4
5
|
const config = getConfig();
|
|
5
|
-
const requestBody = { ...body, modal: "mcp_server" };
|
|
6
|
+
const requestBody = { ...body, modal: "mcp_server", source: brandSource() };
|
|
6
7
|
const response = await fetch(`${config.apiBase}${endpoint}`, {
|
|
7
8
|
method,
|
|
8
9
|
headers: {
|
package/dist/api/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAC1C,QAAgB,EAChB,IAAS,EACT,SAAiB,MAAM;IAEvB,IAAI,CAAC;QACJ,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAE3B,MAAM,WAAW,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,CAAC;QAE5E,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,OAAO,GAAG,QAAQ,EAAE,EAAE;YAC5D,MAAM;YACN,OAAO,EAAE;gBACR,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE;aACxC;YACD,GAAG,CAAC,MAAM,KAAK,KAAK,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC;SAC9D,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAClB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,MAAM,MAAM,SAAS,EAAE,CAAC,CAAC;QAC1E,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAEnC,iCAAiC;QACjC,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,wBAAwB,CAAC;QACtC,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,0DAA0D;QAC1D,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-store.d.ts","sourceRoot":"","sources":["../../src/api/config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-store.d.ts","sourceRoot":"","sources":["../../src/api/config-store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAK5C,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAE/D;AAED,wBAAgB,SAAS,IAAI,MAAM,CAMlC"}
|
package/dist/api/config-store.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { brandApiBase } from "../config/brand.js";
|
|
2
3
|
const configStorage = new AsyncLocalStorage();
|
|
3
4
|
export function runWithConfig(config, fn) {
|
|
4
5
|
return configStorage.run(config, fn);
|
|
5
6
|
}
|
|
6
7
|
export function getConfig() {
|
|
7
8
|
return (configStorage.getStore() ??
|
|
8
|
-
global.
|
|
9
|
-
{ apiKey: "", apiBase:
|
|
9
|
+
global.brandConfig ??
|
|
10
|
+
{ apiKey: "", apiBase: brandApiBase() });
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=config-store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-store.js","sourceRoot":"","sources":["../../src/api/config-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"config-store.js","sourceRoot":"","sources":["../../src/api/config-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,aAAa,GAAG,IAAI,iBAAiB,EAAU,CAAC;AAEtD,MAAM,UAAU,aAAa,CAAI,MAAc,EAAE,EAAW;IAC3D,OAAO,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,SAAS;IACxB,OAAO,CACN,aAAa,CAAC,QAAQ,EAAE;QACvB,MAAc,CAAC,WAAW;QAC3B,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,CACvC,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OAuth2-style authentication provider for the MCP HTTP server
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates API keys and issues JWT access tokens
|
|
4
4
|
*/
|
|
5
5
|
import { InfraNodusUserInfo, TokenResponse, AuthenticatedRequest, RegisteredClient, ClientRegistrationRequest, ClientRegistrationResponse } from "./types.js";
|
|
6
6
|
/**
|
|
7
|
-
* Validate an
|
|
7
|
+
* Validate an API key by calling the /api/v1/userId endpoint
|
|
8
8
|
* Returns user info if valid, null if invalid
|
|
9
9
|
*/
|
|
10
10
|
export declare function validateApiKey(apiKey: string): Promise<InfraNodusUserInfo | null>;
|
|
11
11
|
/**
|
|
12
|
-
* Exchange an
|
|
12
|
+
* Exchange an API key for a JWT access token
|
|
13
13
|
*/
|
|
14
14
|
export declare function exchangeApiKeyForToken(apiKey: string): Promise<TokenResponse | null>;
|
|
15
15
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"oauth-provider.d.ts","sourceRoot":"","sources":["../../src/auth/oauth-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,kBAAkB,EAElB,aAAa,EAEb,oBAAoB,EACpB,gBAAgB,EAChB,yBAAyB,EACzB,0BAA0B,EAE1B,MAAM,YAAY,CAAC;AAmBpB;;;GAGG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAmCvF;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA4B1F;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAmC5E;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAa/C;AAYD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,yBAAyB,GAAG,0BAA0B,CA0B7F;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAEnE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAK/E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAIlF;AAQD;;GAEG;AACH,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,MAAM,GAC1B,MAAM,CAcR;AAeD;;GAEG;AACH,wBAAsB,yBAAyB,CAC9C,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAwC/B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OAuth2-style authentication provider for the MCP HTTP server
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates API keys and issues JWT access tokens
|
|
4
4
|
*/
|
|
5
5
|
import jwt from "jsonwebtoken";
|
|
6
6
|
import crypto from "crypto";
|
|
7
|
+
import { brandApiBase } from "../config/brand.js";
|
|
7
8
|
// In-memory stores
|
|
8
9
|
const sessions = new Map();
|
|
9
10
|
const clients = new Map();
|
|
@@ -11,7 +12,7 @@ const authorizationCodes = new Map();
|
|
|
11
12
|
// Configuration
|
|
12
13
|
const JWT_SECRET = process.env.JWT_SECRET || crypto.randomBytes(32).toString("hex");
|
|
13
14
|
const TOKEN_EXPIRY_SECONDS = 86400 * 365 * 100; // 100 years - effectively never expires
|
|
14
|
-
const
|
|
15
|
+
const BRAND_API_BASE = brandApiBase();
|
|
15
16
|
/**
|
|
16
17
|
* Hash an API key for storage in JWT (we don't store the actual key in the token)
|
|
17
18
|
*/
|
|
@@ -19,12 +20,12 @@ function hashApiKey(apiKey) {
|
|
|
19
20
|
return crypto.createHash("sha256").update(apiKey).digest("hex").slice(0, 16);
|
|
20
21
|
}
|
|
21
22
|
/**
|
|
22
|
-
* Validate an
|
|
23
|
+
* Validate an API key by calling the /api/v1/userId endpoint
|
|
23
24
|
* Returns user info if valid, null if invalid
|
|
24
25
|
*/
|
|
25
26
|
export async function validateApiKey(apiKey) {
|
|
26
27
|
try {
|
|
27
|
-
const response = await fetch(`${
|
|
28
|
+
const response = await fetch(`${BRAND_API_BASE}/userId`, {
|
|
28
29
|
method: "POST",
|
|
29
30
|
headers: {
|
|
30
31
|
"Content-Type": "application/json",
|
|
@@ -55,10 +56,10 @@ export async function validateApiKey(apiKey) {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
/**
|
|
58
|
-
* Exchange an
|
|
59
|
+
* Exchange an API key for a JWT access token
|
|
59
60
|
*/
|
|
60
61
|
export async function exchangeApiKeyForToken(apiKey) {
|
|
61
|
-
// Validate the API key against
|
|
62
|
+
// Validate the API key against the brand API
|
|
62
63
|
const userInfo = await validateApiKey(apiKey);
|
|
63
64
|
if (!userInfo) {
|
|
64
65
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-provider.js","sourceRoot":"","sources":["../../src/auth/oauth-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,MAAM,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"oauth-provider.js","sourceRoot":"","sources":["../../src/auth/oauth-provider.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAalD,mBAAmB;AACnB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;AAChD,MAAM,OAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;AACpD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAA6B,CAAC;AAEhE,gBAAgB;AAChB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACpF,MAAM,oBAAoB,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,wCAAwC;AACxF,MAAM,cAAc,GAAG,YAAY,EAAE,CAAC;AAEtC;;GAEG;AACH,SAAS,UAAU,CAAC,MAAc;IACjC,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAAc;IAClD,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,cAAc,SAAS,EAAE;YACxD,MAAM,EAAE,MAAM;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AED,mEAAmE;IACnE,MAAM,aAAa,GAAG,wBAAwB,GAAG,IAAI,CAAC;IACtD,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE,EAAE,CAAC;QACrD,IAAI,GAAG,GAAG,SAAS,GAAG,aAAa,EAAE,CAAC;YACrC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACvB,OAAO,EAAE,CAAC;QACX,CAAC;IACF,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Brand configuration.
|
|
3
|
+
*
|
|
4
|
+
* One codebase ships as multiple branded MCP servers. The active brand is
|
|
5
|
+
* selected at runtime by the BRAND environment variable (set per deploy target,
|
|
6
|
+
* e.g. in each Fly app's [env] block). This keeps a single source tree and a
|
|
7
|
+
* single built image — only BRAND (and the per-app secrets) differ between
|
|
8
|
+
* deployments.
|
|
9
|
+
*
|
|
10
|
+
* Defaults to "infranodus" (the full product, all tools exposed) when BRAND is
|
|
11
|
+
* unset, so a missing BRAND never silently hides tools.
|
|
12
|
+
*/
|
|
13
|
+
export type BrandId = "infranodus" | "keywordgraph";
|
|
14
|
+
export interface BrandDef {
|
|
15
|
+
id: BrandId;
|
|
16
|
+
/** Human-facing product name shown in titles, resources, and auth pages. */
|
|
17
|
+
name: string;
|
|
18
|
+
/** Bare domain, e.g. for links and copy. */
|
|
19
|
+
domain: string;
|
|
20
|
+
/** Default API base when the brand's *_API_BASE env var is unset. */
|
|
21
|
+
apiBase: string;
|
|
22
|
+
/** Prefix for this brand's env vars: `${envPrefix}_API_KEY`, `${envPrefix}_API_BASE`. */
|
|
23
|
+
envPrefix: string;
|
|
24
|
+
/** MCP server identifier reported to clients. */
|
|
25
|
+
serverName: string;
|
|
26
|
+
/**
|
|
27
|
+
* Tool `name` values NOT registered for this brand. Every tool file is always
|
|
28
|
+
* compiled in; this list is the single source of truth for which ones a brand
|
|
29
|
+
* exposes. New upstream tools appear in every brand automatically unless added
|
|
30
|
+
* here.
|
|
31
|
+
*/
|
|
32
|
+
excludedTools: string[];
|
|
33
|
+
/**
|
|
34
|
+
* npm publish identity. The committed package.json holds one brand; the
|
|
35
|
+
* publish script (scripts/publish-brand.mjs) rewrites these fields for the
|
|
36
|
+
* brand being published, then restores. `binName` must match a launcher in
|
|
37
|
+
* bin/ that bakes in this brand's BRAND value.
|
|
38
|
+
*/
|
|
39
|
+
npm: {
|
|
40
|
+
packageName: string;
|
|
41
|
+
binName: string;
|
|
42
|
+
description: string;
|
|
43
|
+
repository: string;
|
|
44
|
+
keywords: string[];
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export declare const brand: BrandDef;
|
|
48
|
+
/**
|
|
49
|
+
* API key for the active brand. Prefers the brand-specific var
|
|
50
|
+
* (`${envPrefix}_API_KEY`) and falls back to the other brand's var so a single
|
|
51
|
+
* key works in mixed local setups.
|
|
52
|
+
*/
|
|
53
|
+
export declare function brandApiKey(): string;
|
|
54
|
+
/** API base for the active brand: brand-specific env var, else the brand default. */
|
|
55
|
+
export declare function brandApiBase(): string;
|
|
56
|
+
/**
|
|
57
|
+
* Per-instance source tag sent to the API (as `source`) so analytics can tell
|
|
58
|
+
* deploys apart. Brand alone is not enough: e.g. the ExaltGrowth and
|
|
59
|
+
* KeywordGraph apps both run BRAND=keywordgraph, so they share a brand but are
|
|
60
|
+
* distinct instances.
|
|
61
|
+
*
|
|
62
|
+
* Resolution order:
|
|
63
|
+
* 1. MCP_SOURCE — explicit per-deploy override (set in each fly.*.toml).
|
|
64
|
+
* 2. FLY_APP_NAME — auto-injected by Fly; the trailing `-mcp-server` is
|
|
65
|
+
* stripped so e.g. `exaltgrowth-mcp-server` → `exaltgrowth`.
|
|
66
|
+
* 3. brand.id — final fallback for local/npm/smithery runs.
|
|
67
|
+
*/
|
|
68
|
+
export declare function brandSource(): string;
|
|
69
|
+
/** Whether a tool (by its MCP `name`) is exposed for the active brand. */
|
|
70
|
+
export declare function isToolEnabled(name: string): boolean;
|
|
71
|
+
//# sourceMappingURL=brand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../../src/config/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,MAAM,OAAO,GAAG,YAAY,GAAG,cAAc,CAAC;AAEpD,MAAM,WAAW,QAAQ;IACxB,EAAE,EAAE,OAAO,CAAC;IACZ,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;OAKG;IACH,GAAG,EAAE;QACJ,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;CACF;AAsED,eAAO,MAAM,KAAK,EAAE,QAAyB,CAAC;AAE9C;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAOpC;AAED,qFAAqF;AACrF,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAQpC;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|