# CoreStory MCP workflow

Use this workflow in any MCP client. Discover first, scope the project, retrieve narrowly, and preserve evidence boundaries.

## Before you connect

- Use the MCP endpoint and authentication method shown in your CoreStory account or onboarding material. Do not copy tokens into source files, prompts, or chat.

- Confirm the target project is ingested and that your identity is authorized to read it.

- Treat tool discovery as authoritative: available tool names and parameters may change as the service evolves.

## Recommended sequence

1. **Discover:** call `list_projects` and bind the task to an explicit project identifier.

2. **Retrieve governed documents:** use `get_project_prd` or `get_project_techspec` when the question concerns product intent or implementation constraints.

3. **Search semantically:** use `semantic_search` for open-ended questions across the project's indexed context.

4. **Plan:** cite retrieved evidence and identify conflicts, missing context, and assumptions.

5. **Verify:** compare critical claims with source code, tests, and runtime evidence before acting.

## Validation

- The MCP client reports a connected `corestory` server.

- `list_projects` returns only projects your identity should access.

- A project-document or semantic query returns evidence from the expected project.

- The agent cites retrieved context in its plan or answer and distinguishes retrieved facts from inference.

## Failure handling

- For authentication errors, create or rotate credentials through the product workflow; never print a token to diagnose it.

- For missing data, verify project identity and ingestion state before changing the prompt.

- If the advertised tools differ from this guide, use the server's live tool schema and report the documentation drift.
