@rosettesolutions/mcp-client
v0.1.0
Published
TypeScript client for the Lineweight MCP (Model Context Protocol) JSON-RPC endpoint
Maintainers
Readme
Lineweight MCP client
Last updated: 2026-09-14T10:40:00Z (UTC).
TypeScript client for the authenticated Lineweight MCP JSON-RPC endpoint. Install with npm install @rosettesolutions/mcp-client, or build this package locally with npm --prefix packages/mcp-client run build from the application root. Node 20 or newer is required.
Use the base URL of your configured Lineweight deployment and an existing valid identity session token. Offline demo identity is deliberately not accepted as an MCP bearer session. The client sends the API compatibility headers required for mutations. Tenant, project permission, session expiry and revocation checks remain server-side.
Operations and limits
- createProject requires name, code, client, location and trade.
- createCase requires projectId and an input containing document_ids, title, kind (rfi/submittal), number and revision.
- uploadDocument uploads actual PDF bytes through normal intake; MCP uploads are limited to 8 MiB. Use the document interface for larger sources.
- reviewProject(projectId, provider, confirmHostedUse, maxPages) queues the existing durable analysis workflow. Hosted providers require explicit consent and company policy. mock-deterministic is simulated. The return value is a queued analysis, not a completed review.
- getJobStatus(projectId, jobId) polls the durable project job. Streaming reports tool submission/return; completion requires polling the job.
- reviewDocument returns existing permission-filtered findings. It does not invoke a fresh independent document AI review.
- compareDocuments and smartCompare compare stored extracted text in page order. They expose incomplete extraction; they do not establish visual or engineering equivalence.
- exportReport returns the persisted case as JSON or printable HTML. The pdf option returns HTML with pdfRequiresPrint true; print/save it through the report interface.
- Regulatory search and applicability helpers return candidate sources for human review.
- Unexpected tool failures return a generic message with a server-side reference instead of raw error text. Validation, permission and quota messages are unchanged.
Example
import {LineWeightClient} from '@rosettesolutions/mcp-client';
const client = new LineWeightClient({baseUrl: configuredUrl, token: sessionToken});
const project = await client.createProject({name:'Review',code:'REV-1',client:'Example',location:'Confirmed project location',trade:'General'});
const context = await client.getProjectContext(project.id);
for await (const event of client.streamReviewProject(project.id, 'mock-deterministic')) {
console.log(event.event, event.data);
}The SDK tests exercise mutation headers, fragmented UTF-8/CRLF event streams, cancellation and project-scoped job polling. They do not qualify live supplier or AI-provider behaviour.
