Fix: add source to env

This commit is contained in:
Harshith Mullapudi 2025-06-23 13:14:12 +05:30
parent 7bd19c2e18
commit 9f93824ba9
3 changed files with 11 additions and 2 deletions

View File

@ -68,6 +68,15 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
});
async function runServer() {
// Check required environment variables
const requiredEnvVars = ["API_TOKEN", "API_BASE_URL", "SOURCE"];
const missingEnvVars = requiredEnvVars.filter((envVar) => !process.env[envVar]);
if (missingEnvVars.length > 0) {
console.error(`Missing required environment variables: ${missingEnvVars.join(", ")}`);
process.exit(1);
}
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Sigma MCP Server running on stdio");

View File

@ -9,10 +9,11 @@ export async function searchKnowledgeGraph(args: SearchKG) {
});
return response.data;
}
export async function ingestKnowledgeGraph(args: IngestKG) {
const response = await axiosInstance.post(`/ingest`, {
data: args.data,
source: args.source,
source: process.env.SOURCE,
referenceTime: args.referenceTime,
sessionId: args.sessionId ? args.sessionId : undefined,
});

View File

@ -9,7 +9,6 @@ export const SearchKGSchema = z.object({
export const IngestKGSchema = z.object({
data: z.string().describe("The data to ingest in text format"),
source: z.string().describe("The source of the data"),
referenceTime: z.string().describe("The reference time in ISO format"),
sessionId: z.string().optional().describe("The session id of the conversation"),
});