Skip to content

Commit 34d8de9

Browse files
committed
fix: improve npx execution support and restore README
- Fix main module detection to properly handle npx execution - Add support for .bin/littlesis-mcp path detection - Revert README.md to full documentation (from commit f854ff9) - Add Dockerfile for containerization - Update smithery.yml to smithery.yaml format
1 parent abb468c commit 34d8de9

File tree

5 files changed

+56
-83
lines changed

5 files changed

+56
-83
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
2+
FROM node:lts-alpine AS build
3+
WORKDIR /app
4+
5+
# Install dependencies
6+
COPY package.json package-lock.json ./
7+
RUN npm ci --ignore-scripts
8+
9+
# Copy source and build
10+
COPY tsconfig.json ./
11+
COPY src ./src
12+
RUN npm run build
13+
14+
# Production image
15+
FROM node:lts-alpine
16+
WORKDIR /app
17+
ENV NODE_ENV=production
18+
19+
# Copy production artifacts
20+
COPY --from=build /app/dist ./dist
21+
COPY package.json package-lock.json ./
22+
23+
# Install production dependencies
24+
RUN npm ci --production --ignore-scripts
25+
26+
# Start the MCP server
27+
CMD ["node", "dist/index.js"]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# LittleSis MCP Server
22

3+
4+
[![smithery badge](https://smithery.ai/badge/@code-rabi/littlesis-mcp)](https://smithery.ai/server/@code-rabi/littlesis-mcp)
5+
36
An MCP (Model Context Protocol) server that provides access to the [LittleSis API](https://littlesis.org/api) for tracking corporate power and accountability relationships.
47

8+
### Installing via Smithery
9+
10+
To install littlesis-mcp for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@code-rabi/littlesis-mcp):
11+
12+
```bash
13+
npx -y @smithery/cli install @code-rabi/littlesis-mcp --client claude
14+
```
15+
516
## API Coverage
617

718
This MCP server implements all major LittleSis API endpoints:

smithery.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Smithery configuration file: https://smithery.ai/docs/build/project-config
2+
3+
startCommand:
4+
type: http
5+
configSchema:
6+
# JSON Schema defining the configuration options for the MCP.
7+
type: object
8+
properties:
9+
debug:
10+
type: boolean
11+
default: false
12+
description: Enable debug logging
13+
exampleConfig:
14+
debug: false

smithery.yml

Lines changed: 0 additions & 82 deletions
This file was deleted.

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ function createServer({ config }: { config: z.infer<typeof configSchema> }) {
105105
export default createServer;
106106

107107
// Check if this module is being run directly (for stdio compatibility)
108+
// This handles direct execution, npx, and bin script execution
108109
const isMainModule = import.meta.url === `file://${process.argv[1]}` ||
109110
process.argv[1]?.endsWith('index.js') ||
110-
process.argv[1]?.endsWith('dist/index.js');
111+
process.argv[1]?.endsWith('dist/index.js') ||
112+
process.argv[1]?.endsWith('littlesis-mcp') ||
113+
process.argv[1]?.includes('/.bin/littlesis-mcp');
111114

112115
if (isMainModule) {
113116
// Start server with stdio transport when run directly

0 commit comments

Comments
 (0)