fork of cline linear-mcp, fixed for api keys
npm install @odgrim/linear-mcpAn MCP server for interacting with Linear's API. This server provides a set of tools for managing Linear issues, projects, and teams through Cline.
1. Clone the repository
2. Install dependencies:
``bash`
npm install
.env.example
3. Copy to .env:`
bash`
cp .env.example .env
The server supports two authentication methods:
#### Personal Access Token via Environment Variable (Recommended for Dev/Single Users)
1. Go to Linear: Settings > API > OAuth application > "Cline MCP"
2. Under "Developer Token", click "Create & copy token"
3. Select "Application"
4. Add the token to your .env file:`
`
LINEAR_ACCESS_TOKEN=your_personal_access_token
This method is simple and suitable for testing and development environments.
Optionally, you can use an API key here instead.
#### OAuth Flow (Recommended for production)
1. Create an OAuth application at https://linear.app/settings/api/applications
2. Configure OAuth environment variables in .env:`
`
LINEAR_CLIENT_ID=your_oauth_client_id
LINEAR_CLIENT_SECRET=your_oauth_client_secret
LINEAR_REDIRECT_URI=http://localhost:3000/callback
linear_auth
3. Use the tool to initiate the OAuth flow:`
json`
{
"clientId": "your_client_id",
"clientSecret": "your_client_secret",
"redirectUri": "your_redirect_uri"
}
linear_auth_callback
4. Follow the authorization URL to grant access
5. Use the tool with the authorization code:`
json`
{
"code": "authorization_code_from_redirect"
}
This method is more secure and recommended for production environments and multi-user scenarios.
1. Build the server:
`bash`
npm run build
`
2. Start the server:
bash`
npm start
1. Open your Cline MCP settings file:
- macOS: ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json%APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- Windows: ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
- Linux:
2. Add the Linear MCP server configuration:
`json`
{
"mcpServers": {
"linear": {
"command": "node",
"args": ["/path/to/linear-mcp/build/index.js"],
"env": {
"LINEAR_ACCESS_TOKEN": "your_personal_access_token_or_api_key"
},
"disabled": false,
"autoApprove": []
}
}
}
The server currently supports the following operations:
The following features are currently being worked on:
`bashInstall dependencies
npm install
Integration Testing
Integration tests verify that authentication and API calls work correctly:
1. Set up authentication (PAT recommended for testing)
2. Run integration tests:
`bash
npm run test:integration
`For OAuth testing:
1. Configure OAuth credentials in
.env
2. Remove .skip from OAuth tests in src/__tests__/auth.integration.test.ts`