To understand Jim McKelvey, the founder of two local businesses, as well as a third, based in San Francisco, that could alter the world and make him a greater fortune, it might help to start with the third movement of Ludwig van Beethoven’s Moonlight Sonata. But first I need to tell you about McKelvey’s don’t-do list.

Some years back, McKelvey, who is 45 now, was having problems with his digital publishing company, Mira. Founded in 1990, it started off selling PC software and then, as the Internet took off, struggled to make a transition; to what, McKelvey wasn’t sure. At the same time, McKelvey was blowing glass and selling his art-glass pieces. The money he could make from the glass was like an emergency line of credit for his company, but he was having trouble juggling his pursuits. Then, at a conference, he met business guru Jim Collins, author of Good to Great: Why Some Companies Make the Leap… and Others Don’t. Collins “asked me if I had a to-do list, and I said, ‘Oh yes, I do,’ and I showed it to him,” McKelvey told me recently.

“Do you have a don’t-do list?” Collins asked him.

“What’s that?” McKelvey said.

“Make a list of the things you shouldn’t do,” Collins told him.

McKelvey put news on that list. “It was depressing me,” he said. “The 24-hour news cycle is just horrible.”

Then he found himself at home one day watching an episode of Frasier that he’d already seen. “I’d liked the episode, but I didn’t like it the second time, and I thought, ‘This is stupid. I shouldn’t be doing this.’ So I got rid of the TV… And I ended up going nuts because I couldn’t read that much, and I needed something to do at night.”

We were talking in his office at Mira, near South Grand Boulevard. It was sparsely furnished, with boxes scattered around, giving it the temporary feeling of a campaign headquarters. Over the past two years McKelvey has helped build Square, a new, San Francisco–based company that lets anyone with an iPhone, iPad, or Android mobile device and a bank account accept credit-card payments. I’d been asking him about the risks Square assumes and he was looking for papers to illustrate a point when he pulled out some sheet music, the score for Beethoven’s Moonlight Sonata.

“Do you play the piano?” I asked.

“A little bit,” he said.

One day in 2003, McKelvey said, he heard the sonata’s third movement on classical station KFUO-FM and was dumbstruck by its difficulty. “My God,” he thought, “how could anyone learn to play like that?

So McKelvey went to the music department at Washington University, where his father was an engineering professor and where he’d gotten his undergraduate degrees in computer science and economics, and obtained the sonata’s score. “If you look at the notes,” he said, the third movement is “playable; it’s just fast. Each of those notes is played at a fantastic rate of speed. And I thought, how much would I have to practice to be able to move my hands that quickly?”

At the time, he hadn’t played the piano since he was in eighth grade. He’d never played it well. But he got a piano and he began to play, and for the next three years, he played the third movement of the Moonlight Sonata—just that sonata, and just that stormy third movement—obsessively.

“I’d go in to Washington U., practice on the pianos there,” he said. “I’d practice at home. And then, anywhere I was on the road, I would get a piano. Down in the basement where the Houston airport is connected to a hotel, I’d go to the hotel on a layover. I just started looking in ballrooms. They always have a piano somewhere, and you just pull the cover off. They’re usually not locked, and if they are, the locks aren’t that hard to open. I’d just sit down and start playing the piece.”

He had some trouble with hotel employees at first, he said. “They stopped bothering me because the song was getting better.”

When he got to the point where he could play the third movement reasonably well, he says, he got distracted. He’d been taking flying lessons, a 40th-birthday gift from his younger brother, and in 2007 he bought a used Mooney prop plane with proceeds from the glass faucets he crafts. Now he pilots himself in the Mooney sometimes when he travels for work. And he still doesn’t know how to play anything else on the piano.

That Jim McKelvey is successful seems indisputable. But successful at what? He’s founded a string of thriving businesses, although they don’t have that much in common besides McKelvey. “He doesn’t do anything poorly,” says his friend Howard Lerner, co-founder of Kaldi’s Coffee. “I’ve sat next to him while he’s flown a plane, I’ve been in a Bikram yoga studio with him, I’ve sat with him while he’s done math—and the guy doesn’t do anything wrong.”

I first met McKelvey a few days after New Year’s. It was a propitious time for him. He’d stepped away from the day-to-day operations of Square, and he was casting about for his next project—his next problem to solve, his next light-bulb moment. He and his wife, Anna, and their infant son, Jimmy, were just back from a Renaissance Weekend in Charleston, S.C., a gathering of luminaries including McKelvey and, according to the invitation list, Dr. Ruth Westheimer and NBA free-throw record-holder Stan McKenzie. We met at Third Degree Glass Factory on Delmar Boulevard, the art-glass gallery and workshop McKelvey created with Doug Auer.

McKelvey is tall, thin, and almost boyish-looking. He has fine, short brown hair, fair skin, and dark eyes. When we first met, he was wearing jeans and a grayish pullover. At another meeting, he was wearing the same jeans, but a nicer dress shirt that had belonged to a friend who had tired of it, he said. He has a contagious eagerness and not much apparent vanity. When he doesn’t know something, he’s quick to say so. When he likes something, he says “Cool!” and “Wow!” without a trace of irony. His confidence doesn’t seem to derive from knowing the answers to any one thing so much as knowing that he likes looking for answers. He likes to make things—to blow glass, or epoxy the prototypes for Square’s little card-reader.

I told him blowing glass had long seemed esoteric to me, like juggling.

“I like to juggle, too,” he said, “but I’m not very good. I can juggle three objects, but I can’t do anything. It’s a class of activity that I’m sort of drawn to.”

His light-bulb moment for Square came two years ago, he said, at Third Degree. “I was trying to sell a piece of glass. It was over the phone, to a lady in Panama. She was buying one of my glass bathroom faucets… She calls me; she’s going to spend three grand on this thing, and she wants to pay for it with an American Express card.” Until then, he’d accepted MasterCard or Visa for his glass through Third Degree’s account, or checks or cash.

“I said, ‘I’m sorry, I don’t take American Express. Don’t you have a Visa card?’ And she says, ‘No,’ and then she goes through this thing about ‘Maybe my husband has one’ and ‘He’ll be back in a week.’ And I’m sitting here going, ‘God!’ because I’m about to lose the sale.”

“Did you need the money?” I asked.

“When I started blowing glass, I needed money,” he said. “I didn’t become an artist because I wanted to be an artist; I became an artist because I wanted to eat. I’m conditioned to sell my work. If you want a piece of glass, I will jump to attention and make you that thing. It’s ridiculous.”

I asked if his wife, Anna, was still working. She’s a Swedish lawyer.

“No,” he said. “Neither one of us ever has to work again.

“I should tell you the day I realized I was rich,” he continued. “It was about eight years ago. I was driving to lunch at Third Degree, through Forest Park, and there was a radio contest where they were giving away $10,000. The announcer said, “Just think how $10,000 could change your life.’

“If somebody had pulled me over at that moment and handed me a briefcase with $10,000, it wouldn’t change where I had lunch. So I thought about that: How much would someone have to give me to change my life? I had these companies, I had good friends, I got to do everything that I loved… And I came up with $60 million. It wasn’t that I had a lot of money; it was that the next amount of money wasn’t going to change anything.”

We were talking at a worktable at Third Degree. McKelvey sometimes works from his home, which is a modest two-bedroom apartment in Clayton. Last year, he spent stretches in San Francisco at a motel and at an apartment he rents there, and a month in China at the factory that makes Square’s card reader. A few years back, he bought a house and land in Pensacola, Fla., and tried living there, but he found it to be hot, with a lot of bugs. Hurricane Ivan destroyed his Pensacola house in 2004. He rebuilt it, and Hurricane Dennis hit it the next year. He says he won’t rebuild it again.

It was a cold day when we were talking. “It’s nice to have the money to be able to fly off to the Caribbean in January, though,” I said.

“We can do that!” he said. “We’re going to do that. We can do that whenever we want… I’ve met some new friends that do stuff like go to Renaissance Weekend and the Sundance festival. These guys sort of live the millionaire life. For me, it always comes back down to, the people whom I’m around are much more interesting than the activity. I’ve done some fun activities, but it’s more enjoyable to just have a conversation with somebody who’s interesting. And that doesn’t require money.”

McKelvey’s parents, Edith and James Sr., raised him in Ladue as the older of two children, both boys, some of the first members of the post–baby boom generation. Jim was a straight arrow—outgoing, driven, an Eagle Scout, a member of Ladue Horton Watkins High School’s debate team.

“He was very good in school; he was able to learn things very quickly,” his father said. “He had a tremendous ability in communications, in speaking. We thought he might be a lawyer, but that didn’t seem to appeal to him.” His mother was a homemaker who came from a poor family. She remembered the Depression, Jim said, and conveyed a sense of thrift to him.

He entered Washington University in the School of Arts & Sciences. His freshman year, he took a School of Engineering computer class that used a textbook the professor had written. McKelvey thought the book was terrible. On a dare, he wrote his own—and sold it to a publisher. The Debugger’s Handbook: UCSD and Apple Pascal was published when he was 19. “The Washington U. PR machine grabbed hold of this story, ‘Sophomore gets published textbook,’” he said, “so now I’ve got all of this tremendous publicity in the engineering school. I’m sort of a celebrity in the computer-science department.”

“So were they gunning for you at that point?” I asked.

“Engineers don’t do that,” he said. “Engineering is more of a collaborative effort. What you want as an engineer is the smartest people on your team. And as a result of this rep, I get chosen by the best teams… And I learn at the very least to get along with people who are much more intelligent than I am. I was able to get through absolutely the top tier of the engineering school because I was working with people who were fantastic. And working with people who are fantastic is not easy: You have to learn how to handle egos, you have to learn how to challenge, you have to learn how to reward. You have to learn how to punish. There are all these social skills that you need to take someone who has the potential to do great and allow them to do great.”

“So you went to engineering school and learned to be a manager?” I asked.

“Yes,” he said. “I’m good at a few things, but what I’m really good at is working with people who are great at something.”

“You don’t think of yourself as great at something?” I wondered.

“I think I’m great at identifying problems,” he said. “And problems are opportunities; they’re the same thing. So if there’s a problem-slash-opportunity, I will be able to recognize the talents in the people around me who can help solve the problem or grasp that opportunity.”

His friend Howard Lerner went to Wash. U., too. They were in the same fraternity, Sigma Phi Epsilon. “Jim was a genius, no qualification,” he recalls. “He was the first genius I ever met. Even when we were sophomores, I could tell… I think a big part of what makes Jim a genius is that he naturally came to the conclusion at a young age that if you free yourself of the need to judge everything, you can open your mind in a very genuine way. It’s a natural curiosity and an intellectual honesty.”

To fulfill a requirement for his degree, McKelvey took a class in glass blowing. He started working as a contractor for IBM before he left school, and he continued that for several years afterward, while making glass and starting a company that sold CD cabinets. “I became a glass blower because when I graduated from college I didn’t really have a job,” he said. “I woke up one morning and was like, ‘How the hell am I going to pay the rent?’ And I knew how to blow glass. So the light-bulb moment was, I said, ‘You’re now an artist. You’d better figure out what that means and become a good artist, otherwise you’re going to starve.’

“I’d never thought of myself as an artist,” he continued. “I’m an engineer by training; my father’s an engineer. I build things.” He pulled out his desk drawer. “See? I’ve got all sorts of tools and bits of electronics. I mean, I’m a geek. But then they offered me a teacher’s–assistant position at Washington U. in glass blowing, which allowed me to use the facilities there. And I would make work and pack it up in milk crates and walk into galleries and say, ‘Could you sell this?’ Most of the time they said ‘No.’ So I kept making stuff until I found something that would sell.”

“What was that?” I asked.

“Blue objects,” he said. “Blue sells. I ended up making a lot of blue bowls.”

“I knew my mom was hurting,” McKelvey said. “But I didn’t know what to do, and I didn’t do anything…

“What I realized that night, which was the first sleepless night of my life, was that I was mediocre at everything I did. I was a mediocre glass artist; I was a mediocre IBM employee. I was thinking Mom never got to see me do anything great. And I thought, ‘What does it take to do something great?’”

He decided to start a computer company, Mira. It was launched in 1990 around a software program, Look, that worked much like Adobe Acrobat does now, as a universal document reader. His partner helped write the software, while McKelvey sold it. “It was a question of learning by failure, making mistakes, having problems,” McKelvey said.

“What happened was, the trade show for document imaging was one of the worst offenders; there were people who would leave with bags full of literature on how to have a paperless office. So to promote my product, I took everybody’s product literature and scanned it and put it on a CD-ROM using our software, gave it to the whole industry. It was a huge coup. But I didn’t do it for free; I actually charged my competitors $35 or $50 a page to put their literature on my disk, and that turned into a better business than the software business. I made $70,000 on one trade show, and there were like 5,000 trade shows a year. I thought, ‘This is obvious.’ So I started producing trade-show disks,” he recalled. “The company was growing like crazy up until ’94, we were doubling in size every six months, making money, it was fantastic—when the Internet just wiped that business out.”

In 1992, his father had married again, to Dr. Judy Hood, a physician, who would sometimes also answer phones at Mira “just so it looked like someone else worked there,” McKelvey said. In the aftermath of the Internet’s rise, he made Mira a digital publishing company, which it remains.

The Mira staff would frequent a coffee shop near Shenandoah Avenue and South Grand Boulevard, where they’d stock up on chocolate-covered espresso beans to stay awake while they executed McKelvey’s brainstorms. The coffee-shop’s owner, Marcia Dorsey, mentioned that her son was interested in computers. Someone from Mira said they could use a sharp intern. Jack Dorsey was 15 when he showed up at Mira; McKelvey, 25.

“It was the middle of this crazy week when we were working with this insane deadline,” McKelvey said. “We’d scheduled him to come out, but I’d totally forgotten about it. I was working on this computer when this kid tapped me on the shoulder and said, ‘Hi, I’m Jack. My mom said you need some help.’ I said, ‘Oh, great. I’ll be with you in a second’—and I turned back to the computer, and I worked probably for another 45 minutes, totally forgetting about him.”

Dorsey, who went on to co-found Twitter, the popular microblogging service, said he thinks it was more like five to 10 minutes, but who’s counting? When I spoke with him by phone in January, he said he recalled looking over McKelvey’s shoulder that day, trying to determine the software problem that McKelvey was struggling to solve: “I was trying to reverse-engineer what was happening.”

“Then I turned around, and the kid was still there!” McKelvey said. “He was standing in the exact same place… So I said, ‘Can you work a scanner?’ And he said, ‘Yeah,’ so I sat him down with a scanner and a stack of stuff that needed to be scanned, and Jack pulled an all-nighter with us his first day on the job. We sent him home at 5 the next morning or something,” he remembered fondly.

“The big thing I remember is that my parents were furious,” Dorsey said.

“So we sort of became this duo,” McKelvey said. “I had all these new ideas that the company wasn’t digesting very well, but my 15-year-old intern was up for anything.”

“I really didn’t understand the products at that time, but I didn’t care,” Dorsey said. “I wanted to work on software. I wanted to explore that career… I thought, ‘This guy is really young; he’s really smart. He’s built a business; that’s really cool.’ And that opened my eyes to starting a business and building something. My parents were entrepreneurs, too, but you don’t really get it until you see it from another perspective.”

McKelvey eventually left Mira’s operations to better managers, he says. He kept blowing glass, and in 2001 he opened Third Degree with Doug Auer, who still runs the business. McKelvey met Auer when Auer was a teaching assistant in a glass class at Wash. U.

“I’d noticed something about the Washington U. studio he was running,” McKelvey said. “It was running really well. The equipment was kind of crummy, but it was really well-organized. There was clearly somebody who knew what he was doing, who thought about stuff, running it. So I took Doug out to lunch, and he said, ‘I’ve always wanted to have my own studio,’ and I said, ‘Me too. That’s always been a dream.’ And I said, ‘I just don’t have the time.’ And Doug said, ‘Yeah, I don’t have any money.’ And I said, ‘You know, Doug, I’ve got money.’ And he looked at me and said, ‘Jim, I’ve got a lot of time.’”

When I saw McKelvey in early January, he told me he’d just closed Third Degree’s books for 2010. “What we found is that we didn’t make very much money, but we didn’t lose any money, and we paid a lot of people who would otherwise be waiting tables to do what they love, which is work with glass. I think that’s success.”

McKelvey’s brother, Bob, is a pharmaceutical product manager who lives in New Jersey. “When Mira finally got to the point where Mira could exist without [Jim], he moved on to his next venture,” Bob told me. “Each time he’s gotten better. He moved on to Third Degree—bigger risk and bigger reward. It’s a successful business that took a joy for him, glass blowing, and made it profitable. I love skiing, but I didn’t go out and buy a mountain.”

McKelvey never intended to run Third Degree. He wanted a well-run studio where he could make his glass and teach glass blowing. So he was making glass faucets and teaching glass blowing, keeping an eye on Mira, learning the third movement of the Moonlight Sonata, and learning to fly when, in 2007, he realized his friend Donald was depressed.

“It was a situational depression,” McKelvey explained. “He’d been unemployed for two years, and he was just sort of auguring in. I have another friend, Eric, who lives and works in Tokyo, and Eric is just ridiculously rich, off-the-chart-crazy rich. He basically helps rich Japanese avoid paying taxes. It’s not socially productive, but he makes a pile of money, and he’s a nice guy. And he’s single, and he’s constantly just living this insane life. He has a beach house in Japan, and he has a hot tub, and he trucks in mineral water—tankers it in, in these giant tankers, water still hot from the hot springs where it’s gathered. And in his house he stores this mineral water, so if you want to use the hot tub, he fills it up with a thousand gallons of this water and you sit in it, and then when it’s done, he pulls a plug and it all rolls down to the sea.

“So I say to Donald, we’re going to visit him. I got a plane ticket, and we flew out to Tokyo. I wanted to throw as much weird stuff as possible at Donald, so he’d forget how upset he was. And it worked. We just tore that city up and had a ball. And during the process, my rich friend’s company employed this beautiful Swedish attorney. She was wonderful and really smart, speaks six languages. And

I found out as I was leaving town that she didn’t have a boyfriend! I was like, what do you mean?!”

“How did you happen to find that out?” I asked.

“I asked,” he said. “I was like, are you kidding me? Are you out of your mind? What’s wrong with this country?”

That was Anna. He stayed in touch with her by email, and when Eric sent her to St. Louis for work—work that McKelvey says she probably could have done in Tokyo—McKelvey picked her up at the airport, and the courting began. In 2008, he also reconnected with Dorsey, who had to explain to McKelvey what Twitter was. Dorsey had just stepped away from its day-to-day operations.

McKelvey drives a 10-year-old red Honda Insight, a three-cylinder hybrid car that resembles a prop from a low-budget sci-fi film. “It was the first one made,” he explains. “I bought it when they were all pooh-poohing environmental regulations in the Bush administration. I was just pissed off. It’s stupid to buy the first generation of any technology, but I figured if somebody didn’t, they’d never sell.”

Dorsey doesn’t much care for conventional cars, either. So when they got back together in St. Louis over Christmas, they talked about what it would take to build a better electric car. Dorsey was interested in doing something new with mobile devices, McKelvey recalled, and McKelvey realized that he didn’t have the capital to start a car company. “But,” he said, “I can start a computer company, no problem.

“So in the middle of all this, I lose this sale to the lady in Panama, and I’m talking to Jack on my iPhone, and I look at my iPhone and I think, ‘Here is everything that I needed to save that sale. All the hard parts have been done: The network’s here, security’s here, the touchpad is here, everything’s finished, in my hands.’ So I said, ‘What we ought to do is build a payment system to prevent little businesses from getting screwed the way they’ve been getting screwed, because it’s really tough if you’re a small businessman to accept payment cards. You pay a ton of money…2 or 3 percent is the beginning of it, and then you’ve got all these fees, and you’ve got these PCI [security] compliance requirements.”

The credit-card processing cost to the merchant can amount to 6 percent of the gross sale, he said. Square would charge a fixed 2.75 percent rate plus 15 cents per transaction. McKelvey built the prototype card-readers, and Dorsey worked on the software. They launched Square in San Francisco at the end of 2009, with Dorsey as CEO.

McKelvey worked on Square intensely in the beginning, but scaled back his involvement by the end of 2010. “I said I’d do whatever was necessary to get Square to the point where they could hire people that were better than me,” he said. “I think we’ve gotten there now, at least with the stuff I was doing—and I was doing six things [for Square] at once.”

In December, Square and McKelvey sued Robert Morley Jr., an engineering professor at Washington University and a family friend. Morley did some work on the card reader. McKelvey claimed he was left off of a patent that Morley filed for some of the reader’s technology.

Square had 50,000 customers when it left its pilot program in October and has added about another 50,000 businesses a month since then, Dorsey told me in January. The company now has offices in San Francisco, with about 60 employees, and in St. Louis, where eight people have been coding for the Android platform. Square is expanding its St. Louis workforce “as quickly as we can,” McKelvey said. After Square’s second round of funding, also in January, The Wall Street Journal quoted an inside source who said the privately held company was now worth $240 million. Dorsey and McKelvey are

significant shareholders.

McKelvey had mentioned that his rich friend in Tokyo didn’t do work that was socially productive. “Is Square socially productive?” I wondered.

“That’s the reason all of us are at this company,” Dorsey said, speaking by phone from San Francisco. “We think it has a social impact. From the merchant perspective, it’s giving everyone access to the tools that we use. Everyone has a payment card in their pocket, but very few people can accept that. With Square, everyone can participate in commerce, and it’s taking a lot of the financial risk off the table. I think that’s a big deal… I think Square is going to be quite, quite large—on the level of, if not beyond, what Twitter is right now.”

I asked Dorsey if he had any idea what McKelvey might do next, and he said no. “It’s always surprising what he wants to work on. He’s the definition of a Renaissance man. He can do anything he puts his mind to, and it’s not limited to science or engineering or arts. He can do anything.”

“Well, so now what?” I asked McKelvey.

He took a deep breath. “I don’t know,” he said.

We were at Mira. We’d just listened to a YouTube post of someone else playing the third movement of the Moonlight Sonata while McKelvey fingered some of the notes on his desktop. “Start something new, hopefully,” he said after a pause. “I’ve got three or four ideas. I’m running with some of them; I’m sitting on a couple of them. One of them will probably emerge as a leader. Really, what I’m doing now is looking for problems to solve.

“Oh,” he said, “and I’ve got an idea that I can’t quite reveal yet.”

“Come on,” I said. “Is it a tattoo-removal device?”

“No,” he said. “It’s this crazy cosmetic. That’s all I can say, because I have to patent the stupid thing before I talk about it.”