Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(mcp): handle resources absent from aggregate archive (#71694)

Paul D'Ambra2c6b8b84e7d5
diff --git a/services/mcp/tests/integration/manifest.test.ts b/services/mcp/tests/integration/manifest.test.ts
index d992fc1fb111..9affdffb24e5 100644
--- a/services/mcp/tests/integration/manifest.test.ts
+++ b/services/mcp/tests/integration/manifest.test.ts
@@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
import { fetchContextMillResources, loadManifestFromArchive } from '@/resources/internals'
describe('Context-Mill Manifest Integration', () => {
- it('should fetch, unzip, and validate the manifest from GitHub releases', async () => {
+ it('should fetch, unzip, and validate available resources from GitHub releases', async () => {
const archive = await fetchContextMillResources()
// Verify archive is not empty
@@ -16,19 +16,19 @@ describe('Context-Mill Manifest Integration', () => {
expect(validatedManifest.version).toBe('1.0')
expect(Array.isArray(validatedManifest.resources)).toBe(true)
- // Verify we have actual resources
- expect(validatedManifest.resources.length).toBeGreaterThan(0)
+ // The manifest may include resources that are not part of the aggregate archive.
+ const availableResources = validatedManifest.resources.filter((entry) => !entry.file || archive[entry.file])
- // Verify each resource has required fields and its file exists in archive
- for (const entry of validatedManifest.resources) {
+ // Verify the archive contains actual resources
+ expect(availableResources.length).toBeGreaterThan(0)
+
+ // Verify each available resource has required fields
+ for (const entry of availableResources) {
expect(entry.id).toBeTruthy()
expect(entry.name).toBeTruthy()
expect(entry.resource).toBeTruthy()
expect(entry.resource.mimeType).toBeTruthy()
expect(entry.resource.text).toBeTruthy()
- if (entry.file) {
- expect(archive[entry.file]).toBeTruthy()
- }
}
}, 30000)
})